Files
openvino/tests/time_tests/include/timetests_helper/timer.h
T
Victor Kuznetsov 0dd8d895a0 [Time tests] Add API 2.0 support (#9878)
* add performance hint to time infer

* init commit - add api 2 support

* change imInfo filling

* change copyright dates

* check hw positions to default

* add debug info

* fix mistake

* add check layout funcs for api2 time infer

* reformat code (2 -> 4)

* upd with reshape api2

* upd with master

* --

* fix fillTensors - set as template

* fix common_utils.cpp after merge master
2022-02-02 12:33:02 +03:00

32 lines
783 B
C++

// Copyright (C) 2018-2022 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