You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
503 B
C++
20 lines
503 B
C++
4 years ago
|
#ifndef MANGOHUD_TIMING_HPP
|
||
|
#define MANGOHUD_TIMING_HPP
|
||
|
#include <chrono>
|
||
|
|
||
|
#include "mesa/util/os_time.h"
|
||
|
|
||
|
class MesaClock {
|
||
|
public:
|
||
|
using rep = int64_t;
|
||
|
using period = std::nano;
|
||
|
using duration = std::chrono::duration<rep, period>;
|
||
|
using time_point = std::chrono::time_point<MesaClock>;
|
||
|
const static bool is_steady = true;
|
||
|
static time_point now() noexcept {
|
||
|
return time_point(duration(os_time_get_nano()));
|
||
|
}
|
||
|
};
|
||
|
|
||
|
using Clock = MesaClock;
|
||
|
#endif //MANGOHUD_TIMING_HPP
|