AlpacaLibary  1.63
A closed source C++ bot for OSRS
Timer.hpp
Go to the documentation of this file.
1 #ifndef TIMER_HPP_INCLUDED
2 #define TIMER_HPP_INCLUDED
3 
4 #include <iostream>
5 #include <cstdint>
6 
7 class Timer
8 {
9  public:
10  Timer(bool Start = true);
11  void Restart();
12 
13  std::int64_t FastForward(std::uint32_t Duration); // returns time elapsed
14  std::int64_t Rewind(std::uint32_t Duration); // returns time elapsed
15  std::int64_t Suspend(); // returns time elapsed
16  std::int64_t Resume(); // returns time elapsed
17 
18  std::uint64_t GetStartTime() const;
19  std::int64_t GetTimeElapsed() const;
20 
21  bool Paused() const;
22 
23  friend std::ostream& operator<<(std::ostream& OS, const Timer& T);
24  ~Timer();
25  private:
26  std::uint64_t StartTime;
27  std::uint64_t PauseTime;
28  std::int64_t Offset;
29 };
30 
31 #endif // TIMER_HPP_INCLUDED
Definition: Timer.hpp:8
std::int64_t Suspend()
std::int64_t FastForward(std::uint32_t Duration)
std::int64_t GetTimeElapsed() const
bool Paused() const
void Restart()
Timer(bool Start=true)
friend std::ostream & operator<<(std::ostream &OS, const Timer &T)
std::int64_t Resume()
std::int64_t Rewind(std::uint32_t Duration)
std::uint64_t GetStartTime() const