Added a poor man's profiler.
Fixes for GCC builds.
Fixes for Clang builds.