Shouldn't the timer be started just before the shell command being executed? I'm not sure we care about the performance of sprinf?