overloaded printMessage method to add a time parameter