Reputation: 1316
I am trying to display the milliseconds of the current time on screen but I couldn't do it. I managed to show only the seconds .. any help??
My Code:
datestr(now, 'HH:MM:SS')
Upvotes: 1
Views: 568
Reputation: 4525
just add
'FFF'
for Millisecond in three digits
datestr(now,'HH:MM:SS.FFF')
Upvotes: 2
Reputation: 8401
From the second-to-last row of the format out table, you need the FFF
identifier:
>> datestr(now, 'HH:MM:SS:FFF')
ans =
19:35:59:476
Upvotes: 4