
#ifndef SPECTRE_MATH_TIME_H
#define SPECTRE_MATH_TIME_H

namespace sp {

class Time {
public :
	Time(long value = 0);

	double seconds() const;

	int milliseconds() const;

	long microseconds() const;

	// ----------------------------
	//  Helper construct functions
	// ----------------------------
	static Time seconds(double value);
	static Time milliseconds(int value);
	static Time microseconds(long value);

private :

	// In microseconds.
	long m_value;
};

// ----------------------------
//  Compare
// ----------------------------
bool operator ==(const Time& a, const Time& b);
bool operator !=(const Time& a, const Time& b);
bool operator <(const Time& a, const Time& b);
bool operator <=(const Time& a, const Time& b);
bool operator >(const Time& a, const Time& b);
bool operator >=(const Time& a, const Time& b);

// ----------------------------
//  Arithmetic
// ----------------------------
Time operator +(const Time& a, const Time& b);
Time& operator +=(Time& a, const Time& b);
Time operator -(const Time& a, const Time& b);
Time& operator -=(Time& a, const Time& b);

}; // namespace sp

#endif /* SPECTRE_MATH_TIME_H */
