Time measurement code that works with g++ and clang++.