Cleaned up timing code

For benchmarking and profiling should use cProfile.