2024-04-30 21:41:31 +00:00
|
|
|
#include "fumocommon.h"
|
2024-03-25 05:34:59 +00:00
|
|
|
#include <time.h>
|
|
|
|
|
2024-04-30 21:41:31 +00:00
|
|
|
|
|
|
|
size_t MinSize(size_t a, size_t b)
|
|
|
|
{
|
|
|
|
return a < b ? a : b;
|
|
|
|
}
|
2024-03-25 05:34:59 +00:00
|
|
|
|
2024-04-22 22:13:13 +00:00
|
|
|
Time TimeNow()
|
2024-03-25 05:34:59 +00:00
|
|
|
{
|
|
|
|
struct timespec ts;
|
|
|
|
timespec_get(&ts, TIME_UTC);
|
2024-04-22 22:13:13 +00:00
|
|
|
|
|
|
|
return ts.tv_nsec + ts.tv_sec * ONE_E_9;
|
2024-03-25 05:34:59 +00:00
|
|
|
}
|
|
|
|
|
2024-04-22 22:13:13 +00:00
|
|
|
double TimeNowD()
|
2024-03-25 05:34:59 +00:00
|
|
|
{
|
2024-04-16 22:14:53 +00:00
|
|
|
struct timespec ts;
|
|
|
|
timespec_get(&ts, TIME_UTC);
|
|
|
|
|
|
|
|
return ts.tv_sec + (double)ts.tv_nsec / 1000000000.0;
|
2024-03-25 05:34:59 +00:00
|
|
|
}
|