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.
Asked
Active
Viewed 3,809 times
2 Answers
2
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.

BruceWayne
- 116
- 5
-
thanks for replay, i am not able to see dd/mm/yyyy HH:MM:SS.mmm format, how can i achieve this ?? – Harshan.B Oct 11 '17 at 08:45
-
Use the `strncat(char dest[], char src[], long len);` to append your milli seconds to your local time string. In this case, you need to transform the milli seconds to the type string. You can achieve this by using the `snprintf(char dest[], long len, char format[], ...);` function: `snprintf(stringMilliSeconds, stringLength, "%d", longMilliSeconds);` – BruceWayne Oct 11 '17 at 09:57
0
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