Reduce size of time buffer and use only one fprintf call instead of 4