改了改:- @echo off
- set "t=%time%"
- ::下面放你的代码
- set "t1=%time%"
- if "%t1:~,2%" lss "%t:~,2%" set "add=+24"
- set /a "times=(%t1:~,2%-%t:~,2%%add%)*360000+(1%t1:~3,2%%%100-1%t:~3,2%%%100)*6000+(1%t1:~6,2%%%100-1%t:~6,2%%%100)*100+(1%t1:~-2%%%100-1%t:~-2%%%100)" ,"ss=(times/100)%%60","mm=(times/6000)%%60","hh=times/360000","ms=times%%100"
- echo 本次批处理运行时间为%hh%:%mm%:%ss%.%ms%
复制代码 其实只求时分秒的话,这样算是绕弯了的,但是我比较懒,不想重新写,嘿嘿 |