Re: [Vala] problem using sleep
- From: Frederik <scumm_fredo gmx net>
- To: vala-list <vala-list gnome org>
- Subject: Re: [Vala] problem using sleep
- Date: Sat, 10 Oct 2009 19:17:44 +0200
Arkadi Viner wrote:
I have a small question about this code:
If I add some code below your example would it be executed before
"Process.spawn_command_line_async" ? I mean, the program will go on and only
"Process.spawn_command_line_ async" is delayed ?
Yes, I thought that was what you wanted.
If so, how can I delay the whole program ?
You can use Thread.usleep(microseconds) for that:
------------------------------------------------------------------
int time_min = 5;
Thread.usleep (time_min * 60 * 1000 * 1000);
try {
Process.spawn_command_line_async ("gksudo '/etc/acpi/hibernate.sh'");
} catch (Error e) {
stderr.printf ("%s\n", e.message);
}
------------------------------------------------------------------
Best regards,
Frederik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]