hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
time.cpp File Reference
#include <ctime>
#include <runtime/time/time.h>
#include <stdio.h>
Include dependency graph for time.cpp:

Go to the source code of this file.

Functions

long get_tm_gmtoff (struct tm *t)
 
YoiIntAndIntObjectruntime_time_now ()
 Return the current time as a YoiIntAndIntObject.
 
void runtime_time_sleep (int64_t seconds, int64_t nanoseconds)
 Sleep for a given number of seconds.
 
char * runtime_time_strftime (const char *format, int64_t timestamp)
 Convert a timestamp to a string according to a given format.
 
int64_t runtime_time_localtimezone_offset ()
 Get the local timezone offset in seconds.
 
YoiIntAndIntObjectruntime_time_monotonic_now ()
 Get the current monotonic time as a YoiIntAndIntObject.
 
void runtime_time_finalize (void *memory)
 Finalize the memory created by the time module.
 

Function Documentation

◆ get_tm_gmtoff()

long get_tm_gmtoff ( struct tm *  t)

Definition at line 148 of file time.cpp.

Referenced by runtime_time_localtimezone_offset().

Here is the caller graph for this function:

◆ runtime_time_finalize()

void runtime_time_finalize ( void *  memory)

Finalize the memory created by the time module.

Parameters
memoryThe memory to finalize.

Definition at line 208 of file time.cpp.

◆ runtime_time_localtimezone_offset()

int64_t runtime_time_localtimezone_offset ( )

Get the local timezone offset in seconds.

Returns
int64_t The local timezone offset in seconds.

Definition at line 193 of file time.cpp.

References get_tm_gmtoff().

Here is the call graph for this function:

◆ runtime_time_monotonic_now()

YoiIntAndIntObject * runtime_time_monotonic_now ( )

Get the current monotonic time as a YoiIntAndIntObject.

Returns
YoiIntAndIntObject* The current monotonic time as a YoiIntAndIntObject.
Note
The type-id of the returned object will be audited by the runtime.

Definition at line 200 of file time.cpp.

References YoiIntAndIntObject::create().

Here is the call graph for this function:

◆ runtime_time_now()

YoiIntAndIntObject * runtime_time_now ( )

Return the current time as a YoiIntAndIntObject.

Returns
YoiIntAndIntObject* The current time as a YoiIntAndIntObject.
Note
The type-id of the returned object will be audited by the runtime.

Definition at line 169 of file time.cpp.

References YoiIntAndIntObject::create().

Here is the call graph for this function:

◆ runtime_time_sleep()

void runtime_time_sleep ( int64_t  seconds,
int64_t  nanoseconds 
)

Sleep for a given number of seconds.

Parameters
secondsThe number of seconds to sleep.

Definition at line 177 of file time.cpp.

◆ runtime_time_strftime()

char * runtime_time_strftime ( const char *  format,
int64_t  timestamp 
)

Convert a timestamp to a string according to a given format.

Parameters
formatThe format string.
timestampThe timestamp to convert.
Returns
char* The resulting string.

Definition at line 184 of file time.cpp.

References MAX_TIME_STR_LEN.