Refactoring the timing code.

Creating a separate class for each supported platform with the
corresponding code, and also not executing any timing code when not
needed (i.e., only if a test wants to be measured and either we have
and existing baseline or are creating one).
Fixing comment.