Repeating Timer events

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Repeating Timer events

Submitted by Anonymous on Thu, 08/31/2000 - 22:00. Developers
I am trying to figure out how to get reliable timers that call a callback every x milliseconds. I realize that there are mechanisms that will do that once, or timeouts, but I need one that will remain until I tell it I don`t need it anymore. Does anyone know functions to do that?

Se7en

Anonymous

I would also like to know if there is a function to get the time since the system was turned on in milliseconds, just like the Win32 functions GetTickCount( ) and timeGetTime( ).

Se7en

Anonymous

This is not Motif related question. This is Unix question in general.
Simplest, and most portable way to do this is parse output from `uptime`
command. If you wish get uptime in unportable way then look at source
of `uptime` command.
For example in Linux you can read /proc/uptime file.
BUT THIS IS UNPORTABLE!!! There are no other Unices which have so rich /proc
On other Unices you need `man sysctl`