Add a method for writing the time to the bar.