Bug? 1ms timer fires in 10ms?

rtek1000

Active Member
Licensed User
Longtime User
Hi,

I've done a simple code with timers to check the speed of updating a Label, and really this is not the best way to do this.

But I found something strange, every 1 second, the counter of a 1ms timer counts only 100. I believe that in 1 second it should count 1000 ms.
 

Attachments

  • SlowTimer1.zip
    7.8 KB · Views: 233

rtek1000

Active Member
Licensed User
Longtime User
Well I'm not understanding anything else

I changed the timer from 1ms to 10ms and it shows me a count of 50 per second?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is no bug here. Timers send messages to the internal message queue. When the main thread is free to process the message queue it raises the event.

In your program the main thread is mostly occupied with redrawing the text. If you remove the code that updates the label text then it will count to 800+ every second.

For further discussion please start a new thread in the questions forum.
 
Top