difftime


difftime

Calculates the difference between two arithmetic time values

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

The difftime( ) function returns the difference between two time values, time2 - time1, as a number of seconds. While difftime( ) has the return type double, its arguments have the type time_t. The time_t type is usually, but not necessarily, defined as an integer type such as long or unsigned long.

A common way to obtain the argument values passed to difftime( ) is by successive calls to the time( ) function, which returns the current time as a single arithmetic value.

Example

See the sample program for clock( ) in this chapter.

See Also

asctime( ), ctime( ), gmtime( ), localtime( ), mktime( ), strftime( ), time( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net