aboutsummaryrefslogtreecommitdiff
path: root/src/timer.cc
blob: 162b3fe0c9085a34c5308183e1b9bf94c58c897f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "timer.h"

namespace timer {

std::chrono::time_point<std::chrono::high_resolution_clock> now() {
	return std::chrono::high_resolution_clock::now();
}

double millisecondsSince(
	std::chrono::time_point<std::chrono::high_resolution_clock>& pit) {
	return std::chrono::duration_cast<std::chrono::milliseconds>(
		now() - pit
	).count();
}

double secondsSince(
	std::chrono::time_point<std::chrono::high_resolution_clock>& pit) {
	return std::chrono::duration_cast<std::chrono::seconds>(
		now() - pit
	).count();
}

}