In the C standard, there is a defined library on time and date declared in "time.h". The library is not limited to embedded applications, and widely used in order to obtain information about time and date. This library is supported by IAR Embedded Workbench, and in this article we will take a look at how to use it in the toolchain.
Features that are supported by time.h
The time and date library of the C language is defined in time.h. This header includes data types with respect to time, constants and functions:
Data types and constants
clock_t Data type for representing time
time_t Data type for representing time
struct tm Structure that holds the following data:
int tm_sec;// Sec.
int tm_min;// Min
int tm_hour;// Time
int tm_mday; // Day
int tm_mon;// Month
int tm_year;// Year
int tm_wday;// Day of the week
int tm_yday; // Elapsed date Among from the start of the year
int tm_isdst;// Season flag, such as daylight saving time
CLOCKS_PER_SEC The number of times an internal timing event occurs…