I wrote a scope timer class a while back; https://github.com/stephenlclarke/ScopeTimer. It's tiny, zero-intrusion C++17 RAII scope timer for high-performance code paths.