[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: Question on C
From:       John K Luebs <jkluebs () luebsphoto ! com>
Date:       2004-01-31 5:23:48
Message-ID: 20040131052348.GB1411 () luebsphoto ! com
[Download RAW message or body]

On Thu, Jan 29, 2004 at 11:00:26AM +0100, Daniel Miralles Garc?a wrote:
> > This hasnt anything to do with GTK+ but I was wondering would any one
> > know how to program in a delay( say a delay of 2 seconds after clicking
> > on a button before another event happens). Cheer
> 
> Hi.
> 
> If you want a miliseconds pause, you can use this:
> 
> void pause (int sec, int msec)
> {
> 	struct timespec delay;
> 	delay.tv_sec=sec;
> 	delay.tv_nsec=msec*1000000;
> 	nanosleep(&delay, NULL);
> }
> 
> For instance, pause(0,250); makes a 0'250 seconds pause :)
>

You should probably name it something other than pause as there is a
POSIX function of the same name.

--jkl
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic