TraceInfo class
The C++ Build Insights SDK is compatible with Visual Studio 2017 and later. To see the documentation for these versions, set the Visual Studio Version selector control for this article to Visual Studio 2017 or later. It's found at the top of the table of contents on this page.
The TraceInfo
class is used to access useful properties about a trace being analyzed or relogged.
Syntax
class TraceInfo
{
public:
TraceInfo(const TRACE_INFO_DATA& data);
const unsigned long& LogicalProcessorCount() const;
const long long& TickFrequency() const;
const long long& StartTimestamp() const;
const long long& StopTimestamp() const;
std::chrono::nanoseconds Duration() const;
};
Remarks
Subtract the StartTimestamp
from StopTimestamp
to obtain the number of ticks elapsed during the whole trace. Use TickFrequency
to convert the resulting value into a time unit. For an example of converting ticks to time, see EVENT_DATA.
If you don't want to convert ticks yourself, the TraceInfo
class provides a member function that returns the trace duration in nanoseconds. Use the standard C++ chrono
library to convert this value into other time units.
Members
Constructors
Functions
Duration LogicalProcessorCount StartTimestamp StopTimestamp TickFrequency
Duration
std::chrono::nanoseconds Duration() const;
Return Value
The duration of the activity in nanoseconds.
LogicalProcessorCount
const unsigned long& LogicalProcessorCount() const;
Return Value
The number of logical processors on the machine where the trace was collected.
StartTimestamp
const long long& StartTimestamp() const;
Return Value
A tick value captured at the time the trace was started.
StopTimestamp
const long long& StopTimestamp() const;
Return Value
A tick value captured at the time the trace was stopped.
TickFrequency
const long long& TickFrequency() const;
Return Value
The number of ticks per second to use when evaluating a duration measured in ticks.
TraceInfo
TraceInfo(const TRACE_INFO_DATA& data);
Parameters
data
The data containing the information about the trace.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for