timers: clean up for readability
Just doing a little bit of clean up in timers to — hopefully — make it a bit easier to grok.
- Remove micro-optimizations that no longer yield any benefits
- Simplify Timeout & Immediate to just run all their setup code in the constructor instead of needing extra helper functions
- Simplify Timeout to just have a single argument that determines whether it's repeating or not, instead of having two separate helper functions that differ in only one line
- Adjust timers benchmarks to run long enough to offer meaningful data
I ran a benchmark locally and the performance seemed to remain equivalent but will start a Benchmark CI immediately to confirm.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
benchmark, timers