I am usually using
echo.|time & my_command & echo.|time
when I have nothing else at hand. This causes output like the following:
> echo.|time & ping -n 4 localhost > nul & echo.|time
The current time is: 18:42:34,63
Enter the new time:
The current time is: 18:42:37,68
Enter the new time:
Not pretty and can be made prettier by piping to findstr:
echo.|time|findstr current & ping -n 4 localhost > nul & echo.|time|findstr current
If you have delayed expansion enabled by default (or started cmd with /v:on as argument) you can also just use echo !time! without having to resort to ugly hacks with input redirection.
If you want to use a batch file, you can do it like this:
@echo Start time: %time%
@%*>nul 2>nul
@echo End time: %time%
I have added redirection to nul for both stdout and stderr here, because otherwise it might be difficult to find the start and end lines. You may remove this if this is of no concern to you.
But nowadays I mostly use TimeThis.