Is there a more Object Oriented alternative to using gettimeofday() in C++ on linux? I like for instance to be able to write code similar to this:
DateTime now = new DateTime;
DateTime duration = new DateTime(2300, DateTime.MILLISECONDS)
DateTime deadline = now + duration;
while(now < deadline){
DoSomething();
delete now;
now = new DateTime()
}
The target is an embedded linux system and there are no Boost libraries, but maybe there is something that is easy to port (something implemented with header files only for example).
There is no object-oriented interface for dealing with time and intervals that's part of the standard C++ library.
You might want to look at Boost.Date_Time though. Boost is so useful and well written that its practically a part of the standard C++ library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With