Tizen RT Libs&Environment  v1.0 D5

Provides APIs for Time. More...

Collaboration diagram for TIME:

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)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int clock_gettime (clockid_t clockid, FAR struct timespec *tp)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int clock_getres (clockid_t clockid, FAR struct timespec *res)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
time_t mktime (FAR struct tm *tp)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
FAR struct tmgmtime (FAR const time_t *timer)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
FAR struct tmgmtime_r (FAR const time_t *timer, FAR struct tm *result)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
size_t strftime (char *s, size_t max, FAR const char *format, FAR const struct tm *tm)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
time_t time (FAR time_t *tloc)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int timer_create (clockid_t clockid, FAR struct sigevent *evp, FAR timer_t *timerid)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int timer_delete (timer_t timerid)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int timer_settime (timer_t timerid, int flags, FAR const struct itimerspec *value, FAR struct itimerspec *ovalue)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int timer_gettime (timer_t timerid, FAR struct itimerspec *value)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int nanosleep (FAR const struct timespec *rqtp, FAR struct timespec *rmtp)
 high-resolution sleep More...
 
EXTERN int gettimeofday (struct timeval *tp, FAR void *tzp)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) 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 APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
#define localtime_r(c, r)   gmtime_r(c, r)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
#define CLOCKS_PER_SEC   (100)
 
#define CLOCK_REALTIME   0
 
#define TIMER_ABSTIME   1
 
typedef uint32_t time_t
 
typedef uint8_t clockid_t
 
typedef FAR void * timer_t
 

Detailed Description

Provides APIs for Time.

Macro Definition Documentation

#define CLK_TCK   (100)

Definition at line 94 of file time.h.

#define CLOCK_REALTIME   0

Definition at line 109 of file time.h.

#define CLOCKS_PER_SEC   (100)

Definition at line 95 of file time.h.

#define EXTERN   extern

Definition at line 86 of file time.h.

#define localtime (   c)    gmtime(c)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0

Definition at line 132 of file time.h.

#define localtime_r (   c,
 
)    gmtime_r(c, r)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0

Definition at line 138 of file time.h.

#define TIMER_ABSTIME   1

Definition at line 122 of file time.h.

Typedef Documentation

typedef uint8_t clockid_t

Definition at line 146 of file time.h.

typedef uint32_t time_t

Definition at line 145 of file time.h.

typedef FAR void* timer_t

Definition at line 147 of file time.h.

Function Documentation

EXTERN time_t clock_calendar2utc ( int  year,
int  month,
int  day 
)

Conversion Calendar/UTC.

based on algorithms from p. 604 of Seidelman, P. K. 1992. Explanatory Supplement to the Astronomical Almanac. University Science Books, Mill Valley.

Parameters
[in]yearto change
[in]monthto change
[in]dayto change
Returns
the specific time
Since
Tizen RT v1.0
EXTERN int clock_daysbeforemonth ( int  month,
bool  leapyear 
)

Get the number of days that occurred before the beginning of the month.

Parameters
[in]thebeginning of the month
[in]leapyear
Returns
the number of days
Since
Tizen RT v1.0
int clock_getres ( clockid_t  clockid,
FAR struct timespec res 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

[SYSTEM CALL API]

Since
Tizen RT v1.0
int clock_gettime ( clockid_t  clockid,
FAR struct timespec tp 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

[SYSTEM CALL API]

Since
Tizen RT v1.0
EXTERN int clock_isleapyear ( int  year)

Return true if the specified year is a leap year.

Parameters
[in]yearto check whether a leap year or not
Returns
if leap year, TRUE or FALSE
Since
Tizen RT v1.0
int clock_settime ( clockid_t  clockid,
FAR const struct timespec tp 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

[SYSTEM CALL API]

Since
Tizen RT v1.0
EXTERN int gettimeofday ( struct timeval tp,
FAR void *  tzp 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0
FAR struct tm* gmtime ( FAR const time_t timer)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0
FAR struct tm* gmtime_r ( FAR const time_t timer,
FAR struct tm result 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0
time_t mktime ( FAR struct tm tp)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0
int nanosleep ( FAR const struct timespec rqtp,
FAR struct timespec rmtp 
)

high-resolution sleep

[SYSTEM CALL API]

Parameters
[in]rqtpThe amount of time to be suspended from execution.
[in]rmtpIf 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)
Returns
On success, remaining time is returned. On failure, ERROR is returned.
Since
Tizen RT v1.0
size_t strftime ( char *  s,
size_t  max,
FAR const char *  format,
FAR const struct tm tm 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0
time_t time ( FAR time_t tloc)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

Since
Tizen RT v1.0
int timer_create ( clockid_t  clockid,
FAR struct sigevent evp,
FAR timer_t timerid 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

[SYSTEM CALL API]

Since
Tizen RT v1.0
int timer_delete ( timer_t  timerid)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

[SYSTEM CALL API]

Since
Tizen RT v1.0
int timer_gettime ( timer_t  timerid,
FAR struct itimerspec value 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

[SYSTEM CALL API]

Since
Tizen RT v1.0
int timer_settime ( timer_t  timerid,
int  flags,
FAR const struct itimerspec value,
FAR struct itimerspec ovalue 
)

POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)

[SYSTEM CALL API]

Since
Tizen RT v1.0