Showing results for 
Search instead for 
Did you mean: 

Arithmetic Overflow Tick Counter with GetLastInputInfo (User32.dll)

Go to solution

Hallo evrybody,


how can Tick Cout return a lesser value than GetLastInputInfo in the attached vi? When i run that vi, i get sometimes an arithmetic overflow when i substract LastInputInfo Time Value from Tick Counter.


I use LabView Base 2015 SP1 (15.0.1f1 32 Bit) On W7 64 bit Proffesional SP1.



0 Kudos
Message 1 of 4

I ran it for about 30 seconds off and on and wasn't able to replicate it. Only reason I can think is if there is an error in the time on the GetLastInputInfo. Check the two links below which talk about the resolution of that function.

Andrew B.
Application Engineer
National Instruments.
0 Kudos
Message 2 of 4

I think both Tck Count and LasInputInfo return ms since start of the OS from the same source. So the resolution should not be an issue.

0 Kudos
Message 3 of 4
Accepted by topic author wladimiripg

I haven't tried it either, but it helps to read the documentation:


While it doesn't give too many details it does say that it doesn't have to be incremental, so you could get older data (which is not what you're seeing) or you could get data coming from another source (for instance, if someone called SendInput). I have no idea which tick count SendInput uses, but that could certainly provide one scenario which explains what you're seeing.


In general, I would say that if you want to compare times, you should make sure you have a canonical time source.

Try to take over the world!
Message 4 of 4