'CAPL function for printing milliseconds?

it is complex to understand the canlogs without milliseconds, is there any function that prints milliseconds in write window. i've already tried with "getLocalTimeString()" function but this will print only time till seconds only.



Solution 1:[1]

Try using the funtion timeNowNS(); returning a float variable of the simulation time in nanoseconds. Alternatively use timeNowInt64();. Multiply the returned value with factor to gain seconds/milli seconds as you see fit.

Solution 2:[2]

timeNowNS() will return simulation time in nanoseconds whereas getLocalTime()/getLocalTimeString() will return system time. appending both will make no sense as it won't be accurate

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BruceWayne
Solution 2 HariKrishnaRajoli-MT