ifw-core 7.0.0
 
Loading...
Searching...
No Matches
time.hpp
Go to the documentation of this file.
1
6
7#ifndef IFW_CORE_UTILS_TIME_HPP_
8#define IFW_CORE_UTILS_TIME_HPP_
9
10#include <string>
11#include <sys/sem.h>
12#include <pthread.h>
13#include <mutex>
14
15#include <rad/logger.hpp>
16
18
19
21
25 void Sleep(const float sleep_time);
26
28 double Time();
29
31 void SecondsToTimeSpec(const double time,
32 struct timespec& time_spec);
33
35 void SecondsToTimeVal(const double time,
36 struct timeval& time_val);
37
39 std::string IsoTime(const double time_since_epoch,
40 const uint8_t prec = 6);
41
43 std::string IsoTimeNow(const int8_t prec = 6);
44
45}
46
47#endif // IFW_CORE_UTILS_TIME_HPP_
Definition time.hpp:20
void SecondsToTimeSpec(const double time, struct timespec &time_spec)
Convert time in seconds since epoch to a timespec struct.
Definition time.cpp:27
std::string IsoTime(const double time_since_epoch, const uint8_t prec=6)
Generate ISO8601 timestamp from provided time in seconds since epoch.
Definition time.cpp:41
void SecondsToTimeVal(const double time, struct timeval &time_val)
Convert time in seconds since epoch to timeval struct.
Definition time.cpp:34
double Time()
Return the time in seconds since epoch.
Definition time.cpp:22
std::string IsoTimeNow(const int8_t prec=6)
Generate ISO8601 timestamp from time of invoking this function.
Definition time.cpp:64
void Sleep(const float sleep_time)
Sleep.
Definition time.cpp:16