"ts/nasui/src/serviceWorker.ts" did not exist on "9987014e6aa90e5f974c546633412340d458f945"
time.hpp 488 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
#ifndef MIGRAPH_GUARD_RTGLIB_TIME_HPP
#define MIGRAPH_GUARD_RTGLIB_TIME_HPP

#include <chrono>
5
#include <migraph/config.hpp>
Paul's avatar
Paul committed
6

7
8
namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
Paul's avatar
Paul committed
9

Paul's avatar
Paul committed
10
template <class Duration, class F>
Paul's avatar
Paul committed
11
12
13
14
15
16
17
18
auto time(F f)
{
    auto start = std::chrono::steady_clock::now();
    f();
    auto finish = std::chrono::steady_clock::now();
    return std::chrono::duration_cast<Duration>(finish - start).count();
}

19
} // namespace MIGRAPH_INLINE_NS
Paul's avatar
Paul committed
20
21
22
} // namespace migraph

#endif