::此工具在Win7和Vista下請使用管理員身份運行! @echo off cd.>%windir%/time.log set n= :start mode con cols=45 lines=14 Title 反應速度測試工具 color 8a
set a= set b= set s= set/a n+=1 set t=%time:~9,1% cls&echo.&echo.&echo. echo. echo. echo 反應速度測試工具 echo. echo 當窗口變成紅色的時候,迅速按下回車鍵,程序將 echo. echo 測試你的反應速度并顯示出來,精確度為0.01秒 echo. echo Johnny.R的反應速度為0.11秒,看你能否超越他 echo. echo 看平均反應速度請按 Q echo. echo 按回車鍵開始測試 echo. set /p s= if "%s%"=="q" goto pingjun if "%s%"=="Q" goto pingjun
cls mode con cols=23 lines=6 title 開始測試... echo.&echo. color 0a ping -n %t% 127.1 >nul color 4a set a=%time:~3,2%%time:~6,2%%time:~9,2% pause >nul set b=%time:~3,2%%time:~6,2%%time:~9,2% set /a b-=a ::減去程序運行時0.01秒的運算速度 set /a b-=1 echo.&echo. if "%b:~0,1%"=="%b:~0,2%" goto end3 if "%b:~0,2%"=="%b:~0,3%" goto end1 if not "%b:~0,2%"=="%b:~0,3%" goto end2
::結果 :end1 title 測試結果 cls&echo.&echo. echo 你的反應速度為 0.%b%秒 echo. if "%b:~0,1%"=="2" echo 或許還能更快些... if "%b:~0,1%"=="1" echo 我太崇拜你了! echo %b%>>%windir%/time.log echo 按任意鍵重新開始... pause >nul goto start
:pingjun cls set/a n-=1 set k= for /f %%i in (%windir%/time.log) do ( set /a k+=%%i ) set /a p=k/n title 平均速度 mode con cols=25 lines=8 color 0a if "%p:~0,1%"=="%p:~0,2%" goto end4 if "%p:~0,2%"=="%p:~0,3%" goto end5 if not "%p:~0,2%"=="%p:~0,3%" goto end6 echo 未知錯誤... ping -n 2 127.1>nul goto start