Moves timestamp functionality into a separate function to support windows+linux