Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - clock http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   clock

   Usage
   #include <time.h>
   clock_t clock(void);

   Description
   Determines the processor time used by the calling process at the  time
   clock  is executed. IBM PCs have granularities of 1/18 sec.  Other  MS
   DOS machines have only 1 sec granularity, although the time is  always
   returned in 1/100ths of a second.

   The  typedef clock_t is the long data integer type that  results  from
   the use of clock, and represents system clock ticks.

   Example
   #include <stdio.h>
   #include <time.h>
   main()
   {
   clock_t process;
        process = clock()/CLOCKS_PER_SEC;
        printf("Processor time in seconds %ld",process);
   }

   Return Value
   Returns  an approximation of the processor time used thus far  by  the
   calling program. Division of the return value of clock by the value of
   the  CLOCK_PER_SEC macro yields the time in seconds. If the  processor
   time  used  is not available or its value cannot be  represented,  the
   function returns -1.


See Also: Time_package asctime ctime difftime localtime

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson