Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>clock() number of clock ticks since execution started</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 clock()                 Number of Clock Ticks Since Execution Started

 #include <time.h>

  clock_t clock(void);

        This function returns the processor time used since the beginning
        of the program as measured in clock ticks. You can divide the
        return value by the constant CLK_TCK to convert to seconds.

       Returns:     Processor time since starting the program (in
                    clock tics).

         Notes:     Divide by CLK_TCK to get seconds.

   -------------------------------- Example ---------------------------------

 #include <time.h>
 #include <stdio.h>
 #include <dos.h>

 int main(void)

    clock_t my_start, my_end;
    my_start = clock();

    {...do work...}

    my_end = clock();
    printf("Work took %f", my_end - my_start, "clock ticks.\n");

    return 0;


See Also: time()

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