Pull getMicroseconds out into a function, and use it in multiple places.