Fixed CustomTimer

* No timer would be written to the log if it wasn't forced immediately (wrong (writePending) condition was changed to (!writePending))
* Added logging of the time per call since the last log item was written. Good for immediately written timers to look for single long measurements.
(cherry picked from commit f9d7a5cae870b55af6ed325b557a66f32cb27c53)