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>difftime</b> 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);

   ANSI

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>

   #include <stdlib.h>

   int 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(finish, start));
       return EXIT_SUCCESS;
   }

Return Value

   Returns the difference between time1 and time2 in seconds.

See Also

   Time package, asctime, clock, ctime, gmtime, localtime, mktime, time



See Also: asctime clock ctime gmtime localtime mktime time

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