16 #ifndef GRU_TIME_UTILS_H
17 #define GRU_TIME_UTILS_H
25 #if !defined(_WIN32) && !defined(_WIN64)
uint64_t gru_time_to_milli(const gru_timestamp_t *ts)
Converst a timestamp to milliseconds.
Definition: gru_time_utils.c:97
gru_timestamp_t gru_time_from_milli_char(const char *ts)
Converts an unformatted string of milliseconds since epoch to a timestamp.
Definition: gru_time_utils.c:91
struct timeval gru_timestamp_t
An alias to struct timeval.
Definition: gru_time_utils.h:42
uint64_t gru_time_now_milli()
Gets the current moment in time in milliseconds.
Definition: gru_time_utils.c:72
#define gru_export
Definition: gru_portable.h:19
gru_timestamp_t gru_time_read_str(const char *str)
Read a string in the format seconds.microseconds and return a struct timeval.
Definition: gru_time_utils.c:26
void gru_time_add_minutes(gru_timestamp_t *t, uint64_t count)
Add minutes to a timestamp object.
Definition: gru_time_utils.c:22
char * gru_time_write_str(const gru_timestamp_t *t)
Write a timeval structure to a string.
Definition: gru_time_utils.c:55
gru_timestamp_t gru_time_now()
Gets the current moment in time.
Definition: gru_time_utils.c:65
gru_timestamp_t gru_time_from_milli(int64_t timestamp)
Converts milliseconds since epoch to a timestamp.
Definition: gru_time_utils.c:78
void gru_time_add_seconds(gru_timestamp_t *t, uint64_t count)
Copyright 2016 Otavio Rodolfo Piske.
Definition: gru_time_utils.c:18