2024-01-20 10:27:23 +01:00
|
|
|
//--STRIP
|
|
|
|
#ifndef SFW_TIME_H
|
|
|
|
#define SFW_TIME_H
|
|
|
|
//--STRIP
|
2024-01-07 10:49:16 +01:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// time framework utils
|
|
|
|
// - originally by rlyeh, public domain.
|
|
|
|
|
|
|
|
//--STRIP
|
|
|
|
#include "core/int_types.h"
|
|
|
|
//--STRIP
|
|
|
|
|
2024-01-13 19:08:12 +01:00
|
|
|
class SFWTime {
|
2024-01-07 10:49:16 +01:00
|
|
|
public:
|
|
|
|
static uint64_t date(); // YYYYMMDDhhmmss
|
|
|
|
static uint64_t date_epoch(); // linux epoch
|
|
|
|
static char *date_string(); // "YYYY-MM-DD hh:mm:ss"
|
|
|
|
static double time_hh();
|
|
|
|
static double time_mm();
|
|
|
|
static double time_ss();
|
|
|
|
static uint64_t time_ms();
|
|
|
|
static uint64_t time_us();
|
|
|
|
static uint64_t time_ns();
|
|
|
|
static void sleep_ss(double ss);
|
|
|
|
static void sleep_ms(double ms);
|
|
|
|
static void sleep_us(double us);
|
|
|
|
static void sleep_ns(double us);
|
|
|
|
};
|
|
|
|
|
2024-01-20 10:27:23 +01:00
|
|
|
//--STRIP
|
2024-01-07 10:49:16 +01:00
|
|
|
#endif
|
2024-01-20 10:27:23 +01:00
|
|
|
//--STRIP
|