LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to tell elapsed time

Solved!
Go to solution

I believe the tick count starts when the PC first powers up.

 

It doesn't matter when it actually rolls over, if you do the subtraction, the way the math works out with the unsigned integers is that it still works out.  Now if the tick count rolled over twice (>49 days up to ~99 days depending on how close the original tick count was to rolling over) between tick counts, then you could have an error of 49 days.

Message 11 of 16
(1,186 Views)

ah huh! Yes, very nice. It doesn't much matter when the tick count starts as long as your elapsed time is less than ~49 days. Thansk Ravens Fan

0 Kudos
Message 12 of 16
(1,182 Views)

I know I'm late to the party but my preference is to use the ms tick count. The reason being that if you use "get seconds" and if the time is adjusted on your computer (Window Time Sync for example), you could end up with a negative elapsed time.

0 Kudos
Message 13 of 16
(984 Views)

@AbandoningCausality wrote:

I know I'm late to the party but my preference is to use the ms tick count. The reason being that if you use "get seconds" and if the time is adjusted on your computer (Window Time Sync for example), you could end up with a negative elapsed time.


There is now also a third option: "High Resolution Relative Seconds". It works similar in many ways like tick count(ms), but is directly in seconds and with much higher resolution. That's what I typically use. If you use SI units to display the elapsed time, it also looks great (I use e.g. "%.2ps" as format).

 

0 Kudos
Message 14 of 16
(969 Views)

If rollover/exceeding 49 days of elapsed time is an issue, and you still want to use the millisecond timer. You could always integrate/sum the intervals between calls?

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 15 of 16
(949 Views)

That only works if you can gaurantee you'll call the integrating function more than once every 49 days.

0 Kudos
Message 16 of 16
(926 Views)