*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> clock (3)              



NAME    [Toc]    [Back]

       clock - Determine processor time

SYNOPSIS    [Toc]    [Back]

       #include <time.h>

       clock_t clock(void);

DESCRIPTION    [Toc]    [Back]

       The clock() function returns an approximation of processor time used by
       the program.

RETURN VALUE    [Toc]    [Back]

       The value returned is the CPU time used so far as a clock_t; to get the
       number  of  seconds  used,  divide by CLOCKS_PER_SEC.  If the processor
       time used is not available or its  value  cannot  be  represented,  the
       function returns the value (clock_t)-1.

CONFORMING TO    [Toc]    [Back]

       ANSI  C.  POSIX requires that CLOCKS_PER_SEC equals 1000000 independent
       of the actual resolution.

NOTES    [Toc]    [Back]

       The C standard allows for arbitrary values at the start of the program;
       subtract  the value returned from a call to clock() at the start of the
       program to get maximum portability.

       Note  that  the	time  can  wrap  around.   On  a  32bit  system  where
       CLOCKS_PER_SEC  equals 1000000 this function will return the same value
       approximately every 72 minutes.

       The times() function call returns more information.

SEE ALSO    [Toc]    [Back]

       getrusage(2), times(2)

GNU				  1993-04-21			      CLOCK(3)
[ Back ]
 Similar pages
Name OS Title
clock OpenBSD determine processor time used
clock NetBSD determine processor time used
clock FreeBSD determine processor time used
__pset_rtctl HP-UX real-time processor set control
intr_strobe_ics_pct HP-UX limit for the percent of time a processor is allowed to spend in interrupt context
ldconfig Linux determine run-time link bindings
pset_assign_cpu Tru64 Assigns a processor to a processor set
assign_cpu_to_pset Tru64 Assigns a processor to a processor set
create_link HP-UX Creates a soft link and optionally specifies an expiration time and an extension time
vxfs_ifree_timelag HP-UX VxFS inode free time lag (specifies the minimum time to be spent on a freelist)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service