37 #ifndef OMPL_UTIL_TIME_
38 #define OMPL_UTIL_TIME_
52 using point = std::chrono::system_clock::time_point;
55 using duration = std::chrono::system_clock::duration;
60 return std::chrono::system_clock::now();
67 auto us = (long)((sec - (
double)s) * 1000000);
68 return std::chrono::seconds(s) + std::chrono::microseconds(us);
74 return std::chrono::duration<double>(d).count();
80 std::time_t pt = std::chrono::system_clock::to_time_t(p);
82 ss << std::put_time(std::localtime(&pt),
"%F %T");
90 explicit ProgressDisplay(std::ostream &os = std::cout);
91 unsigned int operator++();
92 unsigned int count()
const
99 unsigned int count_{0u};
std::chrono::system_clock::time_point point
Representation of a point in time.
point now()
Get the current time point.
std::chrono::system_clock::duration duration
Representation of a time duration.
std::string as_string(const point &p)
Return string representation of point in time.
duration seconds(double sec)
Return the time duration representing a given number of seconds.
Main namespace. Contains everything in this library.