Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » CAPLProfiler::GetCallCount

CAPLProfiler::GetCallCount

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

qword CAPLProfiler::GetCallCount();

Description

Returns the number of measured profiler calls (i.e., times between Start and Stop). With this method, you can also use the profiler to check how often some code is called.

Parameters

Return Values

  • 0: No measurements yet.
  • > 0: Number of measurements.

Example

void MyFunctionProfiler()
{
  CAPLProfiler profiler;
  char avgTimeString[20];
  profiler.Start();

  MyFunction();

  profiler.Stop();
  TimeToString(profiler.GetAverageCallTimeNS(), avgTimeString);
  Write("MyFunction execution time: %s on average (%I64d calls)", avgTimeString, profiler.GetCallCount());
}
StartStopReset