Files
openvino/tests/time_tests/include/timetests_helper/timer.h
T
Ilya Churaev 0c9abf43a9 Updated copyright headers (#15124)
* Updated copyright headers

* Revert "Fixed linker warnings in docs snippets on Windows (#15119)"

This reverts commit 372699ec49.
2023-01-16 11:02:17 +04:00

33 lines
784 B
C++

// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <chrono>
#include <string>
namespace TimeTest {
using time_point = std::chrono::high_resolution_clock::time_point;
/** Encapsulate time measurements.
Object of a class measures time at start and finish of object's life cycle.
When destroyed, reports duration.
*/
class Timer {
private:
std::string name;
time_point start_time;
public:
/// Constructs Timer object and measures start time.
Timer(const std::string &timer_name);
/// Destructs Timer object, measures duration and reports it.
~Timer();
};
#define SCOPED_TIMER(timer_name) TimeTest::Timer timer_name(#timer_name);
} // namespace TimeTest