C++ methods and macros for precise time measurments