C Reference function clock()

Usage of clock():

clock_t clock ( void );

Parameters:

None.

Return Value:

The number of clock ticks elapsed since the program start. If the function fails then it will return a value of -1. The clock_t type is defined in ctime.h.

Explanation:

The function returns the number of clock ticks elapsed since the start of the program. More »


Posted in C Reference time.h Functions | 2 Comments


C Reference function difftime()

Usage of difftime():

double difftime ( time_t time2, time_t time1 );

Parameters:

Time1 and time2 are both time_t objects.

Return Value:

The difference in seconds between time2-time1 will be returned as a floating point double.

Explanation:

Calculates the difference in seconds between time1 and time2. More »


Posted in C Reference time.h Functions | 1 Comment


C Reference macro NULL

The null pointer macro (NULL) is generally used to signify that a pointer does not point to an object.


Posted in C Reference time.h Functions | Comments Off on C Reference macro NULL


C Reference function mktime()

Usage of mktime():

time_t mktime ( struct tm * ptr_time );

Parameters:

The pointer ptr_time points to a tm structure that contains a calendar time, which in turn is broken down into its components.

Return Value:

A time_t value corresponding to the calendar time passed as argument.
If an error occurs then the function mktime() returns a -1 value. More »


Posted in C Reference time.h Functions | Comments Off on C Reference function mktime()


C Reference function time()

Usage of time():

time_t time ( time_t * ptr_time );

Parameters:

ptr_time is a pointer to an object of type time_t. In this object the time value is stored.

It is also allowed to fill in a null pointer, but the a time_t object is still returned by the function time().

Return Value:

The current calendar time as a time_t object. More »


Posted in C Reference time.h Functions | Comments Off on C Reference function time()


C Reference macro NULL

The null pointer macro (NULL) is generally used to signify that a pointer does not point to a object.


Posted in C Reference time.h Functions | Comments Off on C Reference macro NULL


C Reference Macro CLOCKS_PER_SEC

The macro constant expression CLOCKS_PER_SEC specifies the relation between a clock tick and a second (clock ticks per second).

If you divide a count of clock ticks by this expression you get the number of seconds.

The CLK_TCK is an obsolete alias of this macro.

For a usage example take a look at the clock page.


Posted in C Reference time.h Functions | Comments Off on C Reference Macro CLOCKS_PER_SEC


C Reference Structure tm

The time structure tm contains a calendar date and time which are broken down into its components.
Structure containing a calendar date and time broken down into its components.

The structure contains nine members of type integer: More »


Posted in C Reference time.h Functions | Comments Off on C Reference Structure tm


C Reference Time type time_t

The time type (time_t) is capable of representing times and it also support arithmetical operations.

The time function will return this type. It is also used by some other functions of the time.h header file.

It represents the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC. Also called EPOCH time (Unix time stamp). It is widely implemented in the C libraries across ALL platforms.


Posted in C Reference time.h Functions | Comments Off on C Reference Time type time_t


C Reference Unsigned integral type size_t

The unsigned integral type (size_t) corresponds to the integral data type returned by the language operator sizeof. It is used in (among others) in the time.h header file as an unsigned integral type.

In the header file time.h it is used by the function strftime as the type of its parameter maxsize. It is also used as the return type of this function. It is used to express counts of characters.


Posted in C Reference time.h Functions | Comments Off on C Reference Unsigned integral type size_t