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

CAPLProfiler::GetMaximumCallTimeNS

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

Function Syntax

qword CAPLProfiler::GetMaximumCallTimeNS();

Description

Returns the maximum time for a measured profiler call (i.e., time between Start and Stop) in nanoseconds. If there are no measurements yet, returns 0.

Parameters

Return Values

  • 0: No measurements yet.
  • > 0: Maximum time measured.

Example

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

  MyFunction();

  profiler.Stop();
  TimeToString(profiler.GetAverageCallTimeNS(), avgTimeString);
  TimeToString(profiler.GetMaximumCallTimeNS(), maxTimeString);
  Write("MyFunction execution time: %s on average, %s maximum", avgTimeString, maxTimeString);
}
StartStopReset