dt_status_t dt_now()

in src/unix/dt_unix.c [43:57]


dt_status_t dt_now(dt_timestamp_t *result)
{
    if (!result) {
        return DT_INVALID_ARGUMENT;
    }

    struct timespec ts = {0,};
    if (clock_gettime(CLOCK_REALTIME, &ts) < 0) {
        return DT_SYSTEM_CALL_ERROR;
    }

    result->second = ts.tv_sec;
    result->nano_second = ts.tv_nsec;
    return DT_OK;
}