mirror of
https://github.com/slorelee/wimbuilder2.git
synced 2025-05-06 18:25:51 +08:00
output building log time
This commit is contained in:
parent
24fd326a23
commit
aae46b442f
18
bin/Timer.vbs
Normal file
18
bin/Timer.vbs
Normal file
@ -0,0 +1,18 @@
|
||||
Dim timer1, timer2, elapsed
|
||||
If Wscript.Arguments.Count = 0 Then
|
||||
Wscript.echo GetTimestamp
|
||||
ElseIf Wscript.Arguments.Count = 2 Then
|
||||
timer1 = Wscript.Arguments(0)
|
||||
timer2 = Wscript.Arguments(1)
|
||||
elapsed = DateDiff("s", CDate(timer1), CDate(timer2))
|
||||
Wscript.echo elapsed
|
||||
End If
|
||||
|
||||
|
||||
Function GetTimestamp()
|
||||
Dim N, timestamp
|
||||
N = Now
|
||||
timestamp = Year(N) & "-" & Right("0" & Month(N), 2) & "-" & Right("0" & Day(N), 2) & " "
|
||||
timestamp = timestamp & Right("0" & Hour(N), 2) & ":" & Right("0" & Minute(N), 2) & ":" & Right("0" & Second(N), 2)
|
||||
GetTimestamp = timestamp
|
||||
End Function
|
@ -30,6 +30,9 @@ set "LOGFILE=%Factory%\log\%WB_PROJECT%\%LOGSUFFIX%.log"
|
||||
call :MKPATH "%LOGFILE%"
|
||||
rem type nul>"%LOGFILE%"
|
||||
|
||||
set TIMER_START=
|
||||
for /f "delims=" %%t in ('cscript.exe //nologo bin\Timer.vbs') do set TIMER_START=%%t
|
||||
call :cecho PHRASE "%TIMER_START% - Building Start ..."
|
||||
|
||||
if "x%WB_BASE%"=="x" call :NO_ENV_CONF WB_BASE
|
||||
set _WB_BASE_EXTRACTED=0
|
||||
@ -199,6 +202,15 @@ rem =========================================================
|
||||
|
||||
call :CLEANUP 0
|
||||
call WIM_Exporter "%_WB_PE_WIM%"
|
||||
|
||||
|
||||
set TIMER_END=
|
||||
for /f "delims=" %%t in ('cscript.exe //nologo "%WB_ROOT%\bin\Timer.vbs"') do set TIMER_END=%%t
|
||||
|
||||
set TIMER_ELAPSED=
|
||||
for /f "delims=" %%t in ('cscript.exe //nologo "%WB_ROOT%\bin\Timer.vbs" "%TIMER_START%" "%TIMER_END%"') do set TIMER_ELAPSED=%%t
|
||||
call :cecho PHRASE "%TIMER_END% - Building completed in %TIMER_ELAPSED% seconds."
|
||||
|
||||
goto :EOF
|
||||
|
||||
rem =========================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user