File size: 332 Bytes
712dbf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright © 2023 Apple Inc.

#pragma once

#include <chrono>

namespace timer {

using namespace std::chrono;

template <typename R, typename P>
inline double seconds(duration<R, P> x) {
  return duration_cast<nanoseconds>(x).count() / 1e9;
}

inline auto time() {
  return high_resolution_clock::now();
}

} // namespace timer