Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » timeDiff

timeDiff

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

Function Syntax

  • long timeDiff(message m1, NOW); // from 1
  • long timeDiff(message m1, message m2); // from 2

Description

Time difference between messages or between a message and the current time in ms (msg2 - msg1 or now - msg1). Starting with CANalyzer 2.xx this difference can be calculated directly (Units of 10 microseconds).

Parameters

  • Variable of type message
  • Variable of type now

Return Values

Time difference in ms.

Example

diff = timeDiff(m100, now); // CANalyzer 1.x & 2.x
diff = this.time - m100.time; // CANalyzer 2.xx
timeNowtimeNowFloat