Can't understand why timer can measure intervals of 0. ms

Roald Baudoux's icon

Hello,

I have a timer object triggered by a dial, which receives a bang in its right inlet then another bang immedialely afterwards in its left inlet ("t b b"). However this timer sometimes reports time intervals of 0. ms. How is it possible altough both scheduler and event interval cannot be set with values lower than 1. ms ? I suppose it could go below 1. ms when using scheduler in audio interrupt but this is not the case here thus I see no reason for this measurement.

That's a recurrent observation actually but I'd really like to know how this can happen.

Roman Thilenius's icon

i dont think that the event interval setting has something to do with the speed messages can be transported. event interval only affects the GUI but not at all the message queue. you can have hundreds of messages sent within one 1 ms if the computer is fast enough.
why timer can show 0.0? i can only guess: the second bang is coming so fast, that the 32-bit limit disallows max from displaying it more exact than 0.0 - or times uses less than 32 bit, for example 0.001 milliseconds. the latter is probably more realistic. ;)

Roman Thilenius's icon
Roman Thilenius's icon

jokes aside, i just looked into the docs, and they say that the number of events per ms in the high priority thread is (only) 20 by default. did you eventually change that to 10,000?

Roald Baudoux's icon

I'll have a look at cpuclock and next. However feeding two bangs into timer's left then right inlet does not reports zero because the first bang (send to the right inlet) ends the measurement while the second starts the next measurement. A measurement of O. ms means that the trigger object was triggered twice in a very short period (probably shorter than 1. ms and rounded to 0. because of 32 bits precision as indicated by Roman).

By the way, no I haven't changed the poll throtte (as stated in a parallel thread I have also initiated, I think all the settings related to the scheduler should benefit from advanced tutorials and examples).

Thanks for helping.