Turned Kaleidoscope::hasTimeExpired static

The method does not access any non-static class inventory.
This change should bring a small performance gain
as not this pointer needs to be passed when the
function is called.

Signed-off-by: Florian Fleissner <florian.fleissner@inpartik.de>
pull/659/head
Florian Fleissner 6 years ago
parent 5cfc4bb57e
commit 2cf6883a16

@ -167,7 +167,7 @@ class Kaleidoscope_ {
* std::numeric_limits<uint16_t>::max() - x. * std::numeric_limits<uint16_t>::max() - x.
*/ */
template <typename _Timestamp, typename _Timeout> template <typename _Timestamp, typename _Timeout>
bool hasTimeExpired(_Timestamp start_time, _Timeout ttl) { static bool hasTimeExpired(_Timestamp start_time, _Timeout ttl) {
_Timestamp current_time = millis_at_cycle_start_; _Timestamp current_time = millis_at_cycle_start_;
_Timestamp elapsed_time = current_time - start_time; _Timestamp elapsed_time = current_time - start_time;
return (elapsed_time > ttl); return (elapsed_time > ttl);

Loading…
Cancel
Save