Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_Telemetry.h
ben marsh b78d96355f LiveCoding: Merging fixes to resolve issues with global symbols being reconstructed when loading patch DLLs. Was causing asserts when log channels were re-registered etc...
#jira
#rb none

#ROBOMERGE-OWNER: ryan.vance
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 5993252 via CL 5993257 via CL 5995286 via CL 5995562
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR)

[CL 6004844 by ben marsh in Dev-VR branch]
2019-04-18 21:57:56 -04:00

50 lines
883 B
C++

// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
#pragma once
#include "CoreTypes.h"
#include <chrono>
#include "LC_CriticalSection.h"
namespace telemetry
{
// scoped timing information
class Scope
{
public:
explicit Scope(const char* name);
~Scope(void);
double ReadSeconds(void) const;
double ReadMilliSeconds(void) const;
double ReadMicroSeconds(void) const;
void Restart(void);
void End(void);
private:
const char* m_name;
std::chrono::high_resolution_clock::time_point m_start;
CriticalSection m_cs;
};
class Accumulator
{
public:
explicit Accumulator(const char* name);
void Accumulate(uint64_t value);
void ResetCurrent(void);
uint64_t ReadCurrent(void) const;
uint64_t ReadAccumulated(void) const;
void Print(void);
private:
const char* m_name;
uint64_t m_current;
uint64_t m_accumulated;
};
}