Timing a process with windows batch script -
hi , in advance,
i newbie @ developing batch files trying write bat file right create , write ldif file. starting off simple 1st. need time process may more complicated , may need software comparisons later (such bat vs. java later).
right got this:
@ echo "ldif generator" @ echo off :: *** enter file here "within double quotes" set filename="test.ldif" :: *** if file exists, erase previous content ::if exist %filename% echo erase file >%filename% echo hello>%filename% echo created ldif file %filename% set /a sum = 0 /l %%a in (1,1,5) ( echo %%a>>%filename% set a/ sum = "%sum% + %%a" ) echo sum %sum% pause
i trying figure out how add numbers , time process.
it gives me output far:
hello 1 set a/ sum = 0 + 1 2 set a/ sum = 0 + 2 3 set a/ sum = 0 + 3 4 set a/ sum = 0 + 4 5 set a/ sum = 0 + 5
and on cmd sum "0"
i trying show current iterate sum , echo sum @ end , time takes that.
@echo off &setlocal set /a sum = 0 /l %%a in (1,1,5) ( set /a sum+=%%a ) echo sum %sum%
sum 15
Comments
Post a Comment