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++ 3.0r4 - <b>clock</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
clock

Usage


   #include <time.h>
   long 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>
   #include <stdlib.h>

   int main()

   {
       clock_t process;
       process = clock()/CLOCKS_PER_SEC;
       printf("Processor time in seconds %ld",process);
       return EXIT_SUCCESS;
   }

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




See Also: time asctime ctime difftime localtime

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