sead
Loading...
Searching...
No Matches
seadTickTime.h
Go to the documentation of this file.
1#ifndef SEAD_TICK_TIME_H_
2#define SEAD_TICK_TIME_H_
3
4#ifdef cafe
5#include <cafe/os.h>
6#endif // cafe
7
8#include <time/seadTickSpan.h>
9
10namespace sead {
11
12class TickTime
13{
14public:
15 TickTime();
16
17#ifdef cafe
18 void setNow()
19 {
20 mTick = OSGetSystemTime();
21 }
22#else
23 void setNow();
24#endif
25
26 TickSpan diff(TickTime t) const;
27 TickSpan diffToNow() const;
28
29 TickTime& operator+=(TickSpan rhs);
30 TickTime& operator-=(TickSpan rhs);
31
32 u64 toU64() const
33 {
34 return mTick;
35 }
36
37private:
38 u64 mTick;
39};
40
41TickSpan operator-(TickTime lhs, TickTime rhs);
42
43TickTime operator+(TickTime time, TickSpan span);
44TickTime operator-(TickTime time, TickSpan span);
45
46} // namespace sead
47
48#endif // SEAD_TICK_TIME_H_
Definition seadTickSpan.h:12
Definition seadAssert.h:44