29 static Time nanoseconds(i64 value) {
return Time(value); }
30 static Time microseconds(i64 value) {
return Time(value * 1000); }
31 static Time milliseconds(i64 value) {
return Time(value * 1000000); }
32 static Time seconds(i64 value) {
return Time(value * 1000000000); }
33 static Time seconds(
float value) {
return Time(i64(value * 1000000000.f)); }
34 static std::tm local(
const std::time_t &time);
37 Time(i64 value) : ticks(value) { };
39 i64 asNanoseconds()
const {
return ticks; }
40 i64 asMicroseconds()
const {
return ticks / 1000; }
41 i64 asMilliseconds()
const {
return ticks / 1000000; }
42 float asSeconds()
const {
return ticks / 1000000000.f; }
44 bool operator==(
const Time &rhs)
const;
45 bool operator!=(
const Time &rhs)
const;
46 bool operator<=(
const Time &rhs)
const;
47 bool operator>=(
const Time &rhs)
const;
48 bool operator<(
const Time &rhs)
const;
49 bool operator>(
const Time &rhs)
const;
50 Time operator+(
const Time &rhs)
const;
51 Time operator-(
const Time &rhs)
const;
52 Time operator*(
const long i)
const;
53 Time operator/(
const long i)
const;
54 Time& operator+=(
const Time &rhs);
55 Time& operator-=(
const Time &rhs);
56 Time& operator*=(
const long i);
57 Time& operator/=(
const long i);
78 Time getElapsedTime();
92 StopWatch(
const string &description =
"");