You are not logged in.
Pages: 1
:: (C) Edwin A Duncan-Dunlop July 2011 ©
@echo off
md c:\batstore >nul
icacls c:\batstore\speeds.txt /GRANT ADMINISTRATORS:F
TAKEOWN /f c:\batstore\speeds.txt
icacls c:\111store\testspeed.bat /GRANT ADMINISTRATORS:F
TAKEOWN /f c:\batstore\testspeed.bat
SETLOCAL EnableDelayedExpansion
cls
set Ver=V4.21
set xxpp=notxp
choice /?>nul
if errorlevel 1 set xxpp=isxp
ECHO
:start
mode con: cols=55 lines=16 & color 9f
echo.
Echo ^^ ^^ ^^ ^^ SEE COUNTDOWN ABOVE ^^ ^^ ^^ ^^
Echo ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^
echo. ^| ^| ^| ^| ^| ^| ^| ^|
echo.
echo Speed test %ver%
echo.
echo make sure nothing else is running ?
echo test again while downloading something
echo test again while other programs running
echo to see what slows down your PC
echo test again in safemode
echo.
echo under 20 secs is fast, over 40 secs is slow
call :sub1 %time%
set time1=%_millisecs%
set begin=%time%
::: start countdown counter display at 250
:: do task here
for /L %%n in (250,-1,0) do (
for /L %%m in (1,1,650) do echo %%m>nul
title %%n Countdown %~n0
)
:: <nul (set/p _eddie=%%n )
call :sub1 %time%
set time2=%_millisecs%
set /a howlong=%time2%-%time1%
if %howlong% lss 1 goto start
::gone past midnight rerun
set /a secs=(%howlong% /100 )
:: convert back to seconds
color e0 & cls
title %secs% seconds
echo.
echo. Ver=%ver% by Eddie Duncan-Dunlop 2011 ©
echo. start time=%begin% End time=%time%
echo.
echo. Time taken = %howlong% millisecs %secs% seconds
if not exist %systemdrive%\batstore\speeds.txt goto first
call :sub3
echo.
:first
echo.
echo. ^>^> ^>^> THIS TIME = %secs% seconds ^<^< ^<^<
:::: store the date/time score in a file c:\speeds.txt or system drive
echo %Ver%%howlong% Millisecs %date%-%time% .... %secs% Seconds >>%systemdrive%\batstore\speeds.txt
echo.
echo. try running in safe mode (f8 on startup)
echo. or run msconfig to disable some startups
echo.
echo.
set /p keypress="... Enter 'H' to see history or just enter "
::: if you don't want to see a list if the history just press ENTER
if /i %keypress%==h start %systemdrive%\batstore\speeds.txt
:::: =============================end of program===================
:sub1
For /f "usebackq tokens=1,2,3,4 delims=:." %%a in ('%1') Do (
set hh=00%%a
set mm=00%%b
set ss=00%%c
set hs=00%%d
)
set hh=%hh:~-2%
set mm=%mm:~-2%
set ss=%ss:~-2%
set hs=%hs:~-2%
set /a hh=((%hh:~0,1% * 10) + %hh:~1,1%) * 60 * 60 * 100
set /a mm=((%mm:~0,1% * 10) + %mm:~1,1%) * 60 * 100
set /a ss=((%ss:~0,1% * 10) + %ss:~1,1%) * 100
set /a hs=((%hs:~0,1% * 10) + %hs:~1,1%)
set /a _millisecs=hh + mm + ss + hs
goto :eof
:: calculate average of all results
:sub3
set count=0
set total=0
for /f "tokens=2" %%n in (%systemdrive%\batstore\speeds.txt) do (
set /a total="total+%%n"
set /a count+=1
)
if %count%==0 goto :eof
set /a average=%total%/%count%
set /a result="average/100"
set integ=%average:~0,2%
set fract=%average:~2,2%
echo.
echo. last %count% times Average %integ%.%fract% seconds
goto :eof
Offline
1. I like how you just assume that we've all got a C:\batstore\ directory.
2. We know if our computer is fast or not.
3. Use. Code. Tags.
Offline
Pages: 1