Menu

Using C Standard Library Time and Clock Functions
📰

Using C Standard Library Time and Clock Functions

Planet Qt·4 days ago
#19Jqx7VQ
#planetqt#qt#define#time#date
Long article (930 words) — no AI summary yet.
Reading 0:00
15s threshold

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…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.