difftime function(Time Difference) in C Language – example and detail

In the C Programming Language, the difftime feature returns the difference (as measured in seconds) between time0 and time1. When using the difftime function, time0 is the until now time.

Syntax

The syntax for the difftime characteristic in the C Language is:

double difftime(time_t time1, time_t time0);

Parameters or Arguments

time1 The later time to use when calculating the distinction in seconds. time0 The in the past time to use when calculating the distinction in seconds.

Returns

The difftime function returns the distinction (as measured in seconds) between time0 and time1.

Required Header

In the C Language, the required header for the difftime characteristic is:

#include <time.h>

Applies To

In the C Language, the difftime characteristic can be used in the following versions:

ANSI/ISO 9899-1990

Similar Functions

Other C features that are similar to the difftime function:

asctime characteristic ctime function gmtime function localtime feature mktime characteristic strftime feature time feature

See Also

Other C features that are noteworthy when dealing with the difftime function:

clock function <time.h>