TizenRT Libs&Environment
v2.0 M2
|
Provides APIs for Time. More...
![]() |
Files | |
file | time.h |
Data Structures | |
struct | timespec |
structure represents an elapsed time More... | |
struct | timeval |
structure represents an elapsed time More... | |
struct | tm |
Structure containing a calendar date and time. More... | |
struct | itimerspec |
Struct itimerspec is used to define settings for an interval timer. More... | |
Macros | |
#define | EXTERN extern |
Functions | |
int | clock_settime (clockid_t clockid, FAR const struct timespec *tp) |
clock and timer functions More... | |
int | clock_gettime (clockid_t clockid, FAR struct timespec *tp) |
clock and timer functions More... | |
int | clock_getres (clockid_t clockid, FAR struct timespec *res) |
clock and timer functions More... | |
clock_t | clock (void) |
returns the implementation's best approximation to the processor time used by the process since the beginning of a implementation-defined era related only to the process invocation. More... | |
time_t | mktime (FAR struct tm *tp) |
convert broken-down time into time since the Epoch More... | |
FAR struct tm * | gmtime (FAR const time_t *timer) |
convert a time value to a broken-down UTC time More... | |
FAR struct tm * | gmtime_r (FAR const time_t *timer, FAR struct tm *result) |
convert a time value to a broken-down UTC time More... | |
size_t | strftime (char *s, size_t max, FAR const char *format, FAR const struct tm *tm) |
convert date and time to a string More... | |
char * | strptime (const char *buf, const char *fmt, struct tm *tm) |
convert a time string to a time tm structure More... | |
double | difftime (time_t time1, time_t time0) |
calculate time difference More... | |
time_t | time (FAR time_t *tloc) |
get time More... | |
int | timer_create (clockid_t clockid, FAR struct sigevent *evp, FAR timer_t *timerid) |
create a per-process timer More... | |
int | timer_delete (timer_t timerid) |
delete a per-process timer More... | |
int | timer_settime (timer_t timerid, int flags, FAR const struct itimerspec *value, FAR struct itimerspec *ovalue) |
per-process timers More... | |
int | timer_gettime (timer_t timerid, FAR struct itimerspec *value) |
per-process timers More... | |
int | nanosleep (FAR const struct timespec *rqtp, FAR struct timespec *rmtp) |
high-resolution sleep More... | |
EXTERN int | gettimeofday (struct timeval *tv, FAR struct timezone *tz) |
get the date and time More... | |
EXTERN int | clock_isleapyear (int year) |
Return true if the specified year is a leap year. More... | |
EXTERN int | clock_daysbeforemonth (int month, bool leapyear) |
Get the number of days that occurred before the beginning of the month. More... | |
EXTERN time_t | clock_calendar2utc (int year, int month, int day) |
Conversion Calendar/UTC. More... | |
#define | CLK_TCK (100) |
#define | localtime(c) gmtime(c) |
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More... | |
#define | localtime_r(c, r) gmtime_r(c, r) |
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More... | |
#define | CLOCKS_PER_SEC (100) |
#define | CLOCK_REALTIME 0 |
#define | TIMER_ABSTIME 1 |
#define | TM_YEAR_BASE 1900 |
typedef uint32_t | time_t |
typedef uint8_t | clockid_t |
typedef FAR void * | timer_t |
Provides APIs for Time.
#define localtime | ( | c | ) | gmtime(c) |
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
#define localtime_r | ( | c, | |
r | |||
) | gmtime_r(c, r) |
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
clock_t clock | ( | void | ) |
returns the implementation's best approximation to the processor time used by the process since the beginning of a implementation-defined era related only to the process invocation.
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
Conversion Calendar/UTC.
#include <tinyara/time.h>
based on algorithms from p. 604 of Seidelman, P. K. 1992. Explanatory Supplement to the Astronomical Almanac. University Science Books, Mill Valley.
[in] | year | year to change |
[in] | month | month to change |
[in] | day | day to change |
EXTERN int clock_daysbeforemonth | ( | int | month, |
bool | leapyear | ||
) |
Get the number of days that occurred before the beginning of the month.
#include <tinyara/time.h>
[in] | month | the beginning of the month |
[in] | leapyear | leap year |
clock and timer functions
#include <time.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
clock and timer functions
#include <time.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
EXTERN int clock_isleapyear | ( | int | year | ) |
Return true if the specified year is a leap year.
#include <tinyara/time.h>
[in] | year | year to check whether a leap year or not |
clock and timer functions
#include <time.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
calculate time difference
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
get the date and time
#include <sys/time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
convert a time value to a broken-down UTC time
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
convert a time value to a broken-down UTC time
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
convert broken-down time into time since the Epoch
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
high-resolution sleep
#include <time.h>
SYSTEM CALL API
[in] | rqtp | The amount of time to be suspended from execution. |
[in] | rmtp | If the rmtp argument is non-NULL, the timespec structure referenced by it is updated to contain the amount of time remaining in the interval (the requested time minus the time actually slept) |
size_t strftime | ( | char * | s, |
size_t | max, | ||
FAR const char * | format, | ||
FAR const struct tm * | tm | ||
) |
convert date and time to a string
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
char* strptime | ( | const char * | buf, |
const char * | fmt, | ||
struct tm * | tm | ||
) |
convert a time string to a time tm structure
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
get time
#include <time.h>
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
create a per-process timer
#include <time.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int timer_delete | ( | timer_t | timerid | ) |
delete a per-process timer
#include <time.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int timer_gettime | ( | timer_t | timerid, |
FAR struct itimerspec * | value | ||
) |
per-process timers
#include <time.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int timer_settime | ( | timer_t | timerid, |
int | flags, | ||
FAR const struct itimerspec * | value, | ||
FAR struct itimerspec * | ovalue | ||
) |
per-process timers
#include <time.h>
SYSTEM CALL API
POSIX API (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)