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

   Usage
   #include <time.h>
   double difftime (time_t time2, time_t time1);

   Description
   The difftime macro subtracts time1 from time2, that is, calculates the
   time  elapsed  between  time1 and time2. The value  is  calculated  in
   seconds  elapsed. The arguments are normally obtained by two calls  to
   the time function.

   Example
   #include <stdio.h>
   #include <time.h>
   main()
   {
   register int delay;
   time_t start, finish;
        time(&start);
        for (delay = 0; delay < 1000; delay++)
        printf("%d \n", delay);
        time (&finish);
        printf("The delay lasted %.0f seconds",
        difftime(start, finish));
   }


   Return Value
   Returns the difference between time1 and time2 in seconds.


See Also: Time_package asctime clock ctime localtime

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