Skip to main content

Time

Unknown SectionDef:var

MCU_SYS_MEM#

struct timeval time_of_day_offset MCU_SYS_MEM 

Type: struct timeval time_of_day_offset

Functions

gettimeofday(struct timeval tp, void tzp)#

int gettimeofday (struct timeval *tp, void *tzp)

Type: int

Parameters:

  • struct timeval * tp
  • void * tzp

Details#

This function gets the current time of day using the real time clock. The time is written to tp. In this implementation tzp is not used.

Returns:

Zero

_getitimer(int which, struct itimerval *value)#

int _getitimer (int which, struct itimerval *value)

Type: int

Parameters:

  • int which
  • struct itimerval * value

_setitimer(int which, const struct itimerval value, struct itimerval ovalue)#

int _setitimer (int which, const struct itimerval *value, struct itimerval *ovalue)

Type: int

Parameters:

  • int which
  • const struct itimerval * value
  • struct itimerval * ovalue

settimeofday_rtc(const struct timeval *tp)#

static int settimeofday_rtc (const struct timeval *tp)

Type: int

Parameters:

  • const struct timeval * tp

_settimeofday(const struct timeval tp, const struct timezone tzp)#

int _settimeofday (const struct timeval *tp, const struct timezone *tzp)

Type: int

Parameters:

  • const struct timeval * tp
  • const struct timezone * tzp

settimeofday(const struct timeval tp, const struct timezone tzp)#

int settimeofday (const struct timeval *tp, const struct timezone *tzp)

Type: int

Parameters:

  • const struct timeval * tp
  • const struct timezone * tzp

Details#

This function sets the current time of day to the time stored in tp. The timezone (tzp) is ignored.

Returns:

Zero or -1 with errno (see Errno) set to:

  • EIO: IO error when setting the real time clock

times(struct tms *buffer)#

clock_t times (struct tms *buffer)

Type: clock_t

Parameters:

  • struct tms * buffer

Details#

This function populates buffer with the:

  • process user time
  • system time on behalf of the process
  • children process user time
  • children system time on behalf of the process

Returns:

Zero or -1 with errno (see Errno) set to:

  • EINVAL: buffer is NULL

clock_getcpuclockid(pid_t pid, clockid_t *clock_id)#

int clock_getcpuclockid (pid_t pid, clockid_t *clock_id)

Type: int

Parameters:

  • pid_t pid
  • clockid_t * clock_id

Details#

This function is not supported.

Returns:

Zero on success or -1 with errno (see Errno) set to:

  • ENOTSUP: not supported

clock_gettime(clockid_t id, struct timespec *tp)#

int clock_gettime (clockid_t id, struct timespec *tp)

Type: int

Parameters:

  • clockid_t id
  • struct timespec * tp

Details#

This function gets the time of the id clock where id is one of:

  • CLOCK_MONOTONIC
  • CLOCK_REALTIME
  • CLOCK_PROCESS_CPUTIME
  • CLOCK_THREAD_CPUTIME

Returns:

Zero on success or -1 with errno (see Errno) set to:

  • EINVAL: id is not one of the above clocks or tp is NULL

clock_getres(clockid_t id, struct timespec *res)#

int clock_getres (clockid_t id, struct timespec *res)

Type: int

Parameters:

  • clockid_t id
  • struct timespec * res

Details#

This function gets the resolution of the id clock where id is one of:

  • CLOCK_MONOTONIC
  • CLOCK_REALTIME
  • CLOCK_PROCESS_CPUTIME
  • CLOCK_THREAD_CPUTIME

Returns:

Zero on success or -1 with errno (see Errno) set to:

  • EINVAL: id is not one of the above clocks or res is NULL

clock_settime(clockid_t id, const struct timespec *tp)#

int clock_settime (clockid_t id, const struct timespec *tp)

Type: int

Parameters:

  • clockid_t id
  • const struct timespec * tp

Details#

This function is not supported.

Returns:

Zero on success or -1 with errno (see Errno) set to:

  • ENOTSUP: not supported

alarm(unsigned int seconds)#

unsigned int alarm (unsigned int seconds)

Type: unsigned int

Parameters:

  • unsigned int seconds

Details#

Sets an alarm that will send the SIGALRM signal to the calling process.

Returns:

Zero on success

ualarm(useconds_t useconds, useconds_t interval)#

unsigned int ualarm (useconds_t useconds, useconds_t interval)

Type: unsigned int

Parameters:

  • useconds_t useconds
  • useconds_t interval

Details#

Sets an alarm that will send the SIGALRM signal to the calling process.

Returns:

Zero on success

timer_create(clockid_t clock_id, struct sigevent evp, timer_t timerid)#

int timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)

Type: int

Parameters:

  • clockid_t clock_id
  • struct sigevent * evp
  • timer_t * timerid

Details#

Creates a timer.

Returns:

timer_delete(timer_t timerid)#

int timer_delete (timer_t timerid)

Type: int

Parameters:

  • timer_t timerid

Details#

Deletes the specified timer.

Returns:

Zero on success or -1 with errno set to:

  • EINVAL: timerid is not valid

timer_settime(timer_t timerid, int flags, const struct itimerspec value, struct itimerspec ovalue)#

int timer_settime (timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue)

Type: int

Parameters:

  • timer_t timerid
  • int flags
  • const struct itimerspec * value
  • struct itimerspec * ovalue

Details#

Sets the time for the specified timer.

Returns:

timer_gettime(timer_t timerid, struct itimerspec *value)#

int timer_gettime (timer_t timerid, struct itimerspec *value)

Type: int

Parameters:

  • timer_t timerid
  • struct itimerspec * value

Details#

Gets the time from a timer

Returns:

timer_getoverrun(timer_t timerid)#

int timer_getoverrun (timer_t timerid)

Type: int

Parameters:

  • timer_t timerid timer_getoverrun

Details#

Returns:

Details

Unix style time functions are available in as documented herein. The C standard library time functions are also available (see C Standard Library).