方法一:
@echo off
setlocal enabledelayedexpansion
for /l %%a in (60,-1,1) do (
adb shell "cat /proc/vmstat | grep pgpgin; cat /proc/vmstat | grep pgpgout"
set ss=%%~a
if !ss! lss 10 set ss=0%%~a
cls & echo save time 00:00:!ss!
ping 127.0.0.1 -n "2">nul
)
cls & echo Bo..o..o..o..o..o..o..o...M.......
pause
方法二:
@echo off
set a=%time%
echo.
echo 开始时间:%a%
:: 等待10秒
choice /t 12 /d y /n
set b=%time%
echo.
echo 结束时间:%b%
echo.
set /a h1=%a:~0,2%
set /a m1=1%a:~3,2%-100
set /a s1=1%a:~6,2%-100
set /a h2=%b:~0,2%
set /a m2=1%b:~3,2%-100
set /a s2=1%b:~6,2%-100
if %h2% LSS %h1% set /a h2=%h2%+24
set /a ts1=%h1%*3600+%m1%*60+%s1%
set /a ts2=%h2%*3600+%m2%*60+%s2%
set /a ts=%ts2%-%ts1%
set /a s=%ts%%%60
if %s%=10
echo 耗时%s%秒
@pause
方法三: