Go to the first, previous, next, last section, table of contents.


difftime

Syntax

#include <time.h>

double difftime(time_t t1, time_t t0);

Description

This function returns the difference in time, in seconds, from t0 to t1.

Return Value

The number of seconds.

Portability

ANSI, POSIX

Example

time_t t1, t0;
double elapsed;
time(&t0);
do_something();
time(&t1);
elapsed = difftime(t1, t0);


Go to the first, previous, next, last section, table of contents.