|
OSAPI
0.29
Open System API
|
The clock module. More...

Functions | |
| t_status | clock_module_supported (void) |
| Declares if the module is supported on the current implementation. More... | |
| t_status | clock_chrono_start (t_chrono *ctime) |
| Get the current machine/real time in seconds from the epoch. More... | |
| t_status | clock_chrono_stop (t_chrono *ctime) |
| Compute a delta between first measurement (in the start method) and now. More... | |
| t_status | clock_instance_createTimezone (t_time *value, const char *timezone, t_clock *clk) |
| Create a new clock instance based on a given timezone and time value. More... | |
| t_status | clock_instance_createOffset (t_time *value, t_time_offset *offset, t_clock *clk) |
| Create a new clock instance based on a given time offset from the standard time. More... | |
| t_status | clock_instance_getLocalTime (t_clock *clk, t_time *localTime) |
| Get the current local time from a clock. More... | |
| t_status | clock_instance_getTime (t_clock *clk, t_time *stdTime) |
| Get the current standard time from a clock. More... | |
| t_status | clock_instance_update (t_clock *clk) |
| Refresh the clock time. More... | |
| t_status | clock_time_make (int64_t seconds, uint64_t fraction, t_time_precision precision, t_time *tm) |
| Set the time structure with the supplied data. More... | |
| t_status | clock_time_get (t_time *curtime) |
| Get the current machine/real time in seconds from the system epoch. More... | |
| t_status | clock_time_getPrecise (t_time *curtime) |
| Get the current time in the highest available resolution since the machine/OS epoch. More... | |
| t_status | clock_time_getResolution (t_time *tm, int *resolution) |
| Extract the resolution from a time type. More... | |
| t_status | clock_time_print (t_time *ctime, const char *tmString) |
| Print the current time in seconds from the epoch in human readable format. More... | |
| t_status | clock_time_diff (t_time t1, t_time t2, t_time *diff) |
| Return the difference between two times, in seconds. More... | |
| t_status | clock_time_copy (const t_time *source, t_time *target) |
| Perform a copy between two time types. More... | |
| t_status | clock_time_equal (const t_time *t1, const t_time *t2, bool *result) |
| Perform a comparison between two time types. More... | |
| t_status | clock_offset_make (int64_t seconds, uint64_t fraction, t_time_offset *offset) |
| Generate a time offset from components. More... | |
| t_status | clock_offset_copy (const t_time_offset *source, t_time_offset *target) |
| Perform a copy between two time offset types. More... | |
| t_status | clock_offset_apply (t_time *base, t_time_offset *offset, t_time *result) |
| Incorporate a time offset into a new time. More... | |
| t_status | clock_vtime_get (t_time *vtime) |
| Get the current virtual (monotonic) time in seconds. More... | |
| t_status | clock_vtime_getPrecise (t_time *vtime) |
| Get the current monotonic time in the highest available resolution. More... | |
| t_status | clock_timezone_set (const t_char *tz) |
| Set the current process timezone. More... | |
| t_status | clock_timezone_get (t_size size, t_char *tz) |
| Get the current process timezone. More... | |
The clock module.
Get the current machine/real time in seconds from the epoch.
| [out] | ctime | - Initial time |
Compute a delta between first measurement (in the start method) and now.
| [in,out] | ctime | - Current time delta from initial time |
| t_status clock_instance_createOffset | ( | t_time * | value, |
| t_time_offset * | offset, | ||
| t_clock * | clk | ||
| ) |
Create a new clock instance based on a given time offset from the standard time.
| [in] | value | - The time value (standard format) |
| [in] | offset | - The offset value |
| [out] | clk | - The new clock instance |

Create a new clock instance based on a given timezone and time value.
| [in] | value | - The time value (standard format) |
| [in] | timezone | - The timezone information (e.g. CDT) |
| [out] | clk | - The new clock instance |
Get the current local time from a clock.
| [in] | clk | - The current clock |
| [out] | localTime | - The extracted local time |

Get the current standard time from a clock.
| [in] | clk | - The current clock |
| [out] | stdTime | - The extracted local time |
Refresh the clock time.
| [out] | clk | - The updated clock |

| t_status clock_module_supported | ( | void | ) |
Declares if the module is supported on the current implementation.
| t_status clock_offset_apply | ( | t_time * | base, |
| t_time_offset * | offset, | ||
| t_time * | result | ||
| ) |
Incorporate a time offset into a new time.
| [in] | base | - The source time |
| [in] | offset | - The time offset |
| [out] | result | - The result time after applying an offset to a base time |

| t_status clock_offset_copy | ( | const t_time_offset * | source, |
| t_time_offset * | target | ||
| ) |
Perform a copy between two time offset types.
| [in] | source | - Copy from |
| [out] | target | - Copy to |

| t_status clock_offset_make | ( | int64_t | seconds, |
| uint64_t | fraction, | ||
| t_time_offset * | offset | ||
| ) |
Generate a time offset from components.
| [in] | seconds | - Time in seconds from a certain origin |
| [in] | fraction | - The fraction of a second |
| [out] | offset | - The result time offset type |
Perform a copy between two time types.
| [in] | source | - Copy from |
| [out] | target | - Copy to |
Return the difference between two times, in seconds.
| [in] | t1 | - First time |
| [in] | t2 | - Second time |
| [out] | diff | - Time difference |
Perform a comparison between two time types.
| [in] | t1 | - The first time to compare |
| [in] | t2 | - Second time to compare |
| [out] | result | - True if times are the same. False otherwise |
Get the current machine/real time in seconds from the system epoch.
| [out] | curtime | - Current time |

Get the current time in the highest available resolution since the machine/OS epoch.
| [out] | curtime | - Current highest precision time |
Extract the resolution from a time type.
| [in] | tm | - Time information |
| [out] | resolution | - Time precision |
| t_status clock_time_make | ( | int64_t | seconds, |
| uint64_t | fraction, | ||
| t_time_precision | precision, | ||
| t_time * | tm | ||
| ) |
Set the time structure with the supplied data.
| [in] | seconds | - The number of seconds since the machine/OS epoch |
| [in] | fraction | - The fraction of a second |
| [in] | precision | - The precision of this time (seconds, milli, nano, etc.) |
| [out] | tm | - The new time representation |
Print the current time in seconds from the epoch in human readable format.
| [in] | ctime | - The current time |
| [out] | tmString | - Formated time string |
Get the current process timezone.
| [in] | size | - The size of the "tz" string |
| [out] | tz | - The buffer where to copy the time zone information |
Set the current process timezone.
| [in] | tz | - New time zone |
Get the current virtual (monotonic) time in seconds.
| [out] | vtime | - Current virtual time |