I need a fast and portable low resolution (~10 ms) clock to implement timeouts in a high-rps app. Even using clock_gettime
results in an unacceptable reduction in rps. I decided to create my own low-resolution clock based on setitimer
with 10 ms interval and benchmarks showed that it had almost no effect on rps. But I still have some concerns - at the very least, I haven't seen this approach anywhere. Could you tell me if there are any pitfalls with this approach?
Asked
Active
Viewed 54 times
0

drew
- 21
- 1
-
1It'll be easier to advice if you show a [mre] of the setup you've got – Ted Lyngmo May 17 '22 at 22:40
-
1If you also show the code that was not acceptable, maybe we can suggest improvements. – stark May 17 '22 at 23:06
-
1What about `timerfd_create(2)`? – Marco Bonelli May 17 '22 at 23:16