HyperPlatform Programmer's Reference
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
PerfCounter Class Reference

Measure elapsed time of the scope. More...

#include <perf_counter.h>

Collaboration diagram for PerfCounter:
Collaboration graph
[legend]

Public Types

using QueryTimeRoutine = ULONG64()
 

Public Member Functions

 PerfCounter (_In_ PerfCollector *collector, _In_opt_ QueryTimeRoutine *query_time_routine, _In_ const char *location_name)
 Gets the current time using query_time_routine. More...
 
 ~PerfCounter ()
 Measures an elapsed time and stores it to PerfCounter::collector_. More...
 

Static Private Member Functions

static ULONG64 RdTsc ()
 Gets the current time using the RDTSC instruction. More...
 

Private Attributes

PerfCollectorcollector_
 
QueryTimeRoutinequery_time_routine_
 
const char * location_name_
 
const ULONG64 before_time_
 

Detailed Description

Measure elapsed time of the scope.

Definition at line 277 of file perf_counter.h.

Member Typedef Documentation

◆ QueryTimeRoutine

using PerfCounter::QueryTimeRoutine = ULONG64()

Definition at line 279 of file perf_counter.h.

Constructor & Destructor Documentation

◆ PerfCounter()

PerfCounter::PerfCounter ( _In_ PerfCollector collector,
_In_opt_ QueryTimeRoutine query_time_routine,
_In_ const char *  location_name 
)
inline

Gets the current time using query_time_routine.

Parameters
collectorPerfCollector instance to store performance data
query_time_routineA function pointer for getting times
location_nameA function name where being measured

HYPERPLATFORM_PERFCOUNTER_MEASURE_TIME() should be used to create an instance of this class.

Definition at line 288 of file perf_counter.h.

◆ ~PerfCounter()

PerfCounter::~PerfCounter ( )
inline

Measures an elapsed time and stores it to PerfCounter::collector_.

Definition at line 297 of file perf_counter.h.

Here is the call graph for this function:

Member Function Documentation

◆ RdTsc()

static ULONG64 PerfCounter::RdTsc ( )
inlinestaticprivate

Gets the current time using the RDTSC instruction.

Returns
the current time

Definition at line 307 of file perf_counter.h.

Member Data Documentation

◆ before_time_

const ULONG64 PerfCounter::before_time_
private

Definition at line 312 of file perf_counter.h.

◆ collector_

PerfCollector* PerfCounter::collector_
private

Definition at line 309 of file perf_counter.h.

◆ location_name_

const char* PerfCounter::location_name_
private

Definition at line 311 of file perf_counter.h.

◆ query_time_routine_

QueryTimeRoutine* PerfCounter::query_time_routine_
private

Definition at line 310 of file perf_counter.h.


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