Add a printTime() function.

Reduces code by over 65 lines!
Merge pull request #1 from ryanmjacobs/refactor_code

Add a printTime() function.