mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-16 14:47:49 +08:00
add diag helper scripts and adds to the path (#1918)
These scripts are to help us help our users by getting a relative picture of their environment that they can submit with an incident.
This commit is contained in:
committed by
Benjamin Staneck
parent
c5a6afbf5b
commit
3a11d45552
22
vendor/bin/timer.cmd
vendored
Normal file
22
vendor/bin/timer.cmd
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
@echo off
|
||||
|
||||
set start=%~1
|
||||
set end=%~2
|
||||
|
||||
set options="tokens=1-4 delims=:.,"
|
||||
for /f %options% %%a in ("%start%") do set start_h=%%a&set /a start_m=100%%b %% 100&set /a start_s=100%%c %% 100&set /a start_ms=100%%d %% 100
|
||||
for /f %options% %%a in ("%end%") do set end_h=%%a&set /a end_m=100%%b %% 100&set /a end_s=100%%c %% 100&set /a end_ms=100%%d %% 100
|
||||
|
||||
set /a hours=%end_h%-%start_h%
|
||||
set /a mins=%end_m%-%start_m%
|
||||
set /a secs=%end_s%-%start_s%
|
||||
set /a ms=%end_ms%-%start_ms%
|
||||
if %ms% lss 0 set /a secs = %secs% - 1 & set /a ms = 100%ms%
|
||||
if %secs% lss 0 set /a mins = %mins% - 1 & set /a secs = 60%secs%
|
||||
if %mins% lss 0 set /a hours = %hours% - 1 & set /a mins = 60%mins%
|
||||
if %hours% lss 0 set /a hours = 24%hours%
|
||||
if 1%ms% lss 100 set ms=0%ms%
|
||||
|
||||
:: Mission accomplished
|
||||
set /a totalsecs = %hours%*3600 + %mins%*60 + %secs%
|
||||
echo Elapsed Time: %hours%:%mins%:%secs%.%ms% (%totalsecs%.%ms%s total)
|
Reference in New Issue
Block a user