#ifndef THREAD_CLOCK_HPP_
#define THREAD_CLOCK_HPP_

#include <ctime>
#include <chrono>

/**
 * @brief A clock which only advances while a thread is scheduled.
 * 
 * NOTE: Currently this does not report any time progressing on Windows.
 */
class ThreadClock
{
private:
    struct timespec startTime;

public:
    typedef std::chrono::duration<int64_t, std::nano> Duration;

    /**
     * @brief Reset this clock.
     */
    void reset();

    /**
     * @brief Get the current duration of the clock since the start.
     */
    Duration getDuration();
};

#endif