LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Alan Kennington <akenning@dog.topology.org>
  To  : David Lloyd <lloy0076@rebel.net.au>
  Date: Thu, 23 Nov 2000 20:35:06 +1030

Re: Timing Proceses In Linux

On Thu, Nov 23, 2000 at 08:10:19PM +1030, David Lloyd wrote:
> 
> Dmitri!
> 
> > I need to write program which requiers some kind of timer. i need to be able to count 0.1s.
> > how to do that?
> 
> I've changed your subject line. What exactly do you need to count to
> 1/10th of a second for?

Dmitri,

In fact, there are at least 4 categories of timer that you might
be wanting here.

program timer
program clock
command line timer
command line clock

For program timer:
Use select() or usleep() etc.

For program clock, use gettimeofday().

For command line timer, use sleep(1) but that isn't useful for sub-second
timing.

For command line clock, use time(1).

Cheers,
Alan Kennington.

-- 
LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author] [stats]
Return to the LinuxSA Mailing List Information Page