Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <time.h>
    double difftime( time_t time1, time_t time0 );

Description:
    The difftime function calculates the difference between the two calendar
    times:


             time1 - time0


Returns:
    The difftime function returns the difference between the two times in
    seconds as a double.

Example:
    #include <stdio.h>
    #include <time.h>

    void compute( void );

    void main()
      {
        time_t start_time, end_time;

        start_time = time( NULL );
        compute();
        end_time = time( NULL );
        printf( "Elapsed time: %f seconds\n",
            difftime( end_time, start_time ) );
      }

    void compute( void )
      {
        int i, j;

        for( i = 1; i <= 20; i++ ) {
          for( j = 1; j <= 20; j++ )
            printf( "%3d ", i * j );
          printf( "\n" );
        }
      }

Classification:
    ANSI

Systems:
    Math

See Also:
    asctime, clock, ctime, gmtime, localtime, mktime, strftime, time, tzset

See Also: clock mktime

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