#include <sys/resource.h>
#include <sys/time.h>
#endif
+#include "datetime.h"
#include "timedelta.h"
#include "timestamp.h"
#include "units.h"
#include "utils.h"
+using namespace std;
+
namespace Msp {
namespace Time {
FILETIME ft;
SystemTimeToFileTime(&st, &ft);
- epoch=(ft.dwLowDateTime+(int64_t)ft.dwHighDateTime<<32)/10;
+ epoch=(ft.dwLowDateTime+((int64_t)ft.dwHighDateTime<<32))/10;
}
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
- return TimeStamp((ft.dwLowDateTime+(int64_t)ft.dwHighDateTime<<32)/10-epoch);
+ return TimeStamp((ft.dwLowDateTime+((int64_t)ft.dwHighDateTime<<32))/10-epoch);
#endif
}
+string format_now(const string &fmt)
+{
+ return DateTime(now()).format(fmt);
+}
+
/**
Returns the CPU time used by the program so far.
*/