nanogui: Timer API.


Previous by date: 2 Feb 2000 14:42:05 -0000 Re: Truetype fonts, vidar.hokstad.com
Next by date: 2 Feb 2000 14:42:05 -0000 Re: Timer API., Greg Haerr
Previous in thread: 2 Feb 2000 14:42:05 -0000 Timer API., Chris Johns
Next in thread: 2 Feb 2000 14:42:05 -0000 Re: Timer API., Greg Haerr

Subject: Re: Timer API.
From: Kyle Harris ####@####.####
Date: 2 Feb 2000 14:42:05 -0000
Message-Id: <38983F5E.3C45B1FB@nexus-tech.net>


Chris Johns wrote:
> 
> Hello,
> 
> I need to have some timers in my application.
> 
> What is the API ?
>
I don't think Microwindows provides for anything like this. Are you
running Linux (unix)? If so, you can use signal() and alarm() for low
resolution timers. select() and setitimer() can be used for higher
resolutions.
 
> Does anyone have an example ?
>

See the man pages for the above functions.  

Normally, you set up a signal handler for the SIGALRM and use alarm to
start timers.

main()
{
	signal(SIGLARM,sigalrm);
	alarm(5);
	for(;;);
}

void
sigalrm(int signo)
{
	printf("signal from alarm\n");
}

The above timer will pop in 5 seconds.

Later, Kyle.

Previous by date: 2 Feb 2000 14:42:05 -0000 Re: Truetype fonts, vidar.hokstad.com
Next by date: 2 Feb 2000 14:42:05 -0000 Re: Timer API., Greg Haerr
Previous in thread: 2 Feb 2000 14:42:05 -0000 Timer API., Chris Johns
Next in thread: 2 Feb 2000 14:42:05 -0000 Re: Timer API., Greg Haerr


Powered by ezmlm-browse 0.20.