Libraries: AccurateTimer

 

AccurateTimer:

Increased accuracy of the standard timer.


Author: fxsaber

 
And you do not get an error during work? Have you tried testing on weak systems (netbooks, for example)?
 
Andrey Khatimlianskii:
And you do not get an error during work? Have you tried testing on weak systems (netbooks, for example)?

I have never encountered this error. I'll have to try it on a netbook.

 
fxsaber:

Never encountered this error before. I'll have to try it on my netbook.

I've had it a couple of times on a hetzner rented server.

The hint was that the periodic recreation of the timer is a source of potential failures.

 
Andrey Khatimlianskii:

I've had it happen a couple of times on a hetzner rented server.

The implication was that the periodic recreation of the timer was a source of potential failures.

Got it, thanks! There's no insurance against this bug, of course. Perhaps the developers will fix it.

 
fxsaber:

Got it, thanks! There's no insurance against this bug, of course. Perhaps the developers will fix it.

Judging by @Slava 's reference to the description of system errors - unlikely =(

 
Andrey Khatimlianskii:

Judging by @Slava 's reference to the description of system errors - unlikely =(

Slava has already told him his negative opinion. But fxsaber doesn't believe it

 
Rashid Umarov:

Glory has already told him his negative opinion. But fxsaber doesn't believe it

I may have missed something. Could you repeat it?

 
Automated-Trading:

AccurateTimer:

Author: fxsaber

GetMicrosecondCount and EventSetTimer obviously use different time sources and they are bound to diverge because they count different times.

Trying to synchronise them is something to something, it's wrong :-)

 
Maxim Kuznetsov:

GetMicrosecondCount and EventSetTimer obviously use different time sources and they must diverge because they count different times.

Trying to synchronise them is something to something, it's wrong :-)

Put a second timer at 00:00:00:00. And see what time will be after the 300th call of OnTimer. Believe me, you will not see 00:05:00 (five minutes exactly). There will be no such discrepancy with the library.

 
fxsaber:

Set the second timer to 00:00:00:00. And see what time will be after the 300th call of OnTimer. Believe me, you will not see 00:05:00. There will be no such discrepancy with the library.

oh, what a stubborn, dense man :-)

GetMicrosecondTimer is used for profiling, performance measurements and small delays in cycles. Obviously it takes the accounting time of a process or a track for this purpose (developers can specify, but why?).

EventSetTimer takes either monotonic or realtime (the former is more likely), and calls OnTimer in one way or another when the timer ticks. For this purpose it uses system descriptors, which causes some problems, the timer may simply not start via EventSetTimer.

all of the above are different timers. On a loaded machine the differences will be significant and natural