#endif
#include <msp/core/systemerror.h>
#include "datetime.h"
+#include "rawtime_private.h"
#include "timedelta.h"
#include "timestamp.h"
#include "units.h"
namespace Msp {
namespace Time {
-/**
-Returns the current timestamp.
-*/
TimeStamp now()
{
#ifndef WIN32
return DateTime(now()).format(fmt);
}
-/**
-Returns the CPU time used by the program so far.
-*/
TimeDelta get_cpu_time()
{
#ifndef WIN32
#endif
}
-/**
-Sleeps for the given time.
-*/
void sleep(const TimeDelta &d)
{
#ifndef WIN32
- timespec ts = d;
+ timespec ts = rawtime_to_timespec(d.raw());
while(nanosleep(&ts, 0)==-1)
if(errno!=EINTR)
throw system_error("nanosleep");