#ifndef TIMER_HPP_INCLUDED
#define TIMER_HPP_INCLUDED

#include <iostream>
#include <cstdint>

class Timer
{
    public:
        Timer(bool Start = true);
        void Restart();

        std::int64_t FastForward(std::uint32_t Duration); // returns time elapsed
        std::int64_t Rewind(std::uint32_t Duration); // returns time elapsed
        std::int64_t Suspend(); // returns time elapsed
        std::int64_t Resume(); // returns time elapsed

        std::uint64_t GetStartTime() const;
        std::int64_t GetTimeElapsed() const;

        bool Paused() const;

        friend std::ostream& operator<<(std::ostream& OS, const Timer& T);
        ~Timer();
    private:
        std::uint64_t StartTime;
        std::uint64_t PauseTime;
        std::int64_t Offset;
};

#endif // TIMER_HPP_INCLUDED
