5#ifndef HOSHI_LANG_TIME_H
6#define HOSHI_LANG_TIME_H
13#define CLOCK_REALTIME 0
14#define CLOCK_MONOTONIC 1
16int clock_gettime(
int clk_id,
struct timespec *tp);
17int nanosleep(
const struct timespec *req,
struct timespec *rem);
20#define MAX_TIME_STR_LEN 128
34#define LIBTIME_EXPORT extern "C"
unsigned long long gc_refcount
unsigned long long type_id
unsigned long long seconds
unsigned long long nanoseconds
static void gc_refcount_decrease(YoiIntAndIntObject *obj)
static YoiIntAndIntObject * create(int64_t seconds, int64_t nanoseconds)
LIBTIME_EXPORT LIBTIME_NOFFI YoiIntAndIntObject * runtime_time_now()
Return the current time as a YoiIntAndIntObject.
LIBTIME_EXPORT LIBTIME_NOFFI YoiIntAndIntObject * runtime_time_monotonic_now()
Get the current monotonic time as a YoiIntAndIntObject.
LIBTIME_EXPORT LIBTIME_FFI void runtime_time_sleep(int64_t seconds, int64_t nanoseconds)
Sleep for a given number of seconds.
LIBTIME_EXPORT LIBTIME_FFI int64_t runtime_time_localtimezone_offset()
Get the local timezone offset in seconds.
LIBTIME_EXPORT LIBTIME_FFI char * runtime_time_strftime(const char *format, int64_t timestamp)
Convert a timestamp to a string according to a given format.
LIBTIME_EXPORT LIBTIME_FFI void runtime_time_finalize(void *memory)
Finalize the memory created by the time module.