02-06-2025 12:00 PM
Hi, Hope you can help, I am just trying to understand how the milisecond timer works. If you set a timer alone or wire an indicator to it, the output is a number like 1.179578E+8. Only if you subtract one from the other do you get a meaningful number.
Where does 1.179578E+8 come from?
Is there a way to get fractions of a milisecond?
Solved! Go to Solution.
02-06-2025 12:13 PM - edited 02-06-2025 12:20 PM
It is a relative millisecond counter and the absolute value has little meaning. To get better time resolution, use "high resolution relative seconds" instead.
@EdHarris wrote:Where does 1.179578E+8 come from?
It might be related to the elapsed milliseconds since you started the computer, but it will wrap around once U32 is exhausted.
(I cannot open your VI. Consider "save for previous" (2020 or below), before attaching. For example there is nothing called "millisecond timer" so I assume that you are talking about the tick count (= same as the output of various waits) instead.)
02-06-2025 12:20 PM
The number itself is the number of milliseconds since the PC in question was powered on... OR it's how long it's been powered on plus a multiple of the overflow (2^32 ms = approx 49.7 days).
For example, the number you give in your post means that your computer was probably powered on 1 day and about 8 hours and 45 minutes before you obtained that number.
That said, I still agree with Altenbach. Use "high resolution relative seconds" instead.
02-06-2025 02:05 PM
Hi again Altenbach, I have posted an earlier version update in case anyone wants to see. Your solution is a considerable improvement but I did not try it before because the description in detailed help implied that the high res timer only output in seconds not milliseconds. And Kyle your prediction about when my PC restarted is very good. Thanks.
02-06-2025 05:25 PM
@EdHarris wrote:
Your solution is a considerable improvement but I did not try it before because the description in detailed help implied that the high res timer only output in seconds not milliseconds.
The time is a DBL and there is no reason to convert to DBL again. You can easily do micro and nanoseconds by using a SI format.
If you want it in fractional milliseconds, just multiply seconds by 1000, right?