ElectricRCAircraftGuy / eRCaGuy_TimerCounter

An Arduino micros()-like function (encapsulated in a library) with 0.5us precision (since the built-in Arduino micros() function has only 4us precision)
http://www.electricrcaircraftguy.com/2014/02/Timer2Counter-more-precise-Arduino-micros-function.html
31 stars 13 forks source link

Remove unused class member _total_count #6

Open edgar-bonet opened 4 years ago

edgar-bonet commented 4 years ago

This member was only used in the get_count() method, right after being set. Making it a local variable of get_count() makes the class 40% smaller and the method slightly faster. It also speeds-up the constructor and the reset() method.

ElectricRCAircraftGuy commented 4 years ago

Thanks for looking at the library! I'll take a look at this when able. See also my comment here: https://github.com/ElectricRCAircraftGuy/eRCaGuy_TimerCounter/pull/8#issuecomment-665187087. I'd like to do a major re-look at this library before merging PRs, as I've grown a lot since I first wrote it.