<ctime>

Macros

CLOCKS_PER_SEC


Definition

#define CLOCKS_PER_SEC 1000

Description

This constant macro defines the numbers of ticks per second in time specification. This allows for conversions from time in tick count, that is usually given as variable of type time_t.


Types

clock_t


Definition

typedef long clock_t;

Description

This type is used in clock() function to hold the number of ticks since the program started. The number of ticks is a unit of measure, where the constant "CLOCKS_PER_SEC" defines the ticks per second. This means that the number of seconds passed since the program began is equla to CLOCKS_PER_SEC timers value of clock_t returned from the function clock().


time_t


Definition

typedef long time_t;

Description

This type is typically used to hold the number of seconds since midnight January 1, 1970, when the time() function is called. The type is often defined as a long, but may defined as a 64-bit int on newer systems.


tm


Definition

struct tm
{
    int tm_sec;     // Seconds [0, 59]
    int tm_min;     // Minutes [0, 59]
    int tm_hour;    // Hours [0, 23]
    int tm_mday;    // Day of the month [1, 31]
    int tm_mon;     // Month of the year [0, 11]
    int tm_year;    // Years after 1900
    int tm_wday;    // Day of the week [0, 6]
    int tm_yday;    // Day of the year [0, 365]
    int tm_isdst;   // Daylight savings time [0, 1],
                    // 0 means false
};

Description

This struct is used to hold a complete time description, which is usually localized. This variable type is generally assigned via a conversion from a time_t data type variable.