writing timestamp every second