ArmNN
 25.11
Loading...
Searching...
No Matches
WallClockTimer Class Reference

#include <WallClockTimer.hpp>

Inheritance diagram for WallClockTimer:
[legend]
Collaboration diagram for WallClockTimer:
[legend]

Public Types

using clock = std::chrono::steady_clock

Public Member Functions

 WallClockTimer ()=default
 ~WallClockTimer ()=default
void Start () override
void Stop () override
const char * GetName () const override
std::vector< MeasurementGetMeasurements () const override
Public Member Functions inherited from Instrument
virtual ~Instrument ()
virtual bool HasKernelMeasurements () const

Static Public Attributes

static const std::string WALL_CLOCK_TIME
static const std::string WALL_CLOCK_TIME_START
static const std::string WALL_CLOCK_TIME_STOP

Detailed Description

Definition at line 38 of file WallClockTimer.hpp.

Member Typedef Documentation

◆ clock

using clock = std::chrono::steady_clock

Definition at line 60 of file WallClockTimer.hpp.

Constructor & Destructor Documentation

◆ WallClockTimer()

WallClockTimer ( )
default

◆ ~WallClockTimer()

~WallClockTimer ( )
default

Member Function Documentation

◆ GetMeasurements()

std::vector< Measurement > GetMeasurements ( ) const
overridevirtual

Implements Instrument.

Definition at line 30 of file WallClockTimer.cpp.

31{
32 const auto delta = std::chrono::duration<double, std::micro>(m_Stop - m_Start);
33 const auto startTimeMs = std::chrono::duration<double, std::micro>(m_Start.time_since_epoch());
34 const auto stopTimeMs = std::chrono::duration<double, std::micro>(m_Stop.time_since_epoch());
35
36 return { { WALL_CLOCK_TIME, delta.count(), Measurement::Unit::TIME_US },
37 { WALL_CLOCK_TIME_START, startTimeMs.count(), Measurement::Unit::TIME_US },
38 { WALL_CLOCK_TIME_STOP, stopTimeMs.count(), Measurement::Unit::TIME_US } };
39}

References Measurement::TIME_US, WALL_CLOCK_TIME, WALL_CLOCK_TIME_START, and WALL_CLOCK_TIME_STOP.

◆ GetName()

const char * GetName ( ) const
overridevirtual

Implements Instrument.

Definition at line 15 of file WallClockTimer.cpp.

16{
17 return "WallClockTimer";
18}

◆ Start()

void Start ( )
overridevirtual

Implements Instrument.

Definition at line 20 of file WallClockTimer.cpp.

21{
22 m_Start = clock::now();
23}

◆ Stop()

void Stop ( )
overridevirtual

Implements Instrument.

Definition at line 25 of file WallClockTimer.cpp.

26{
27 m_Stop = clock::now();
28}

Member Data Documentation

◆ WALL_CLOCK_TIME

const std::string WALL_CLOCK_TIME
static

◆ WALL_CLOCK_TIME_START

const std::string WALL_CLOCK_TIME_START
static

◆ WALL_CLOCK_TIME_STOP

const std::string WALL_CLOCK_TIME_STOP
static

The documentation for this class was generated from the following files: