add sleep time argument and timestamp printf