I can save and view the cygwin console output (stdout and stderr) using the following command,
python command.py 2>&1 | tee -a outFile.txt// Note -a is for appending
since I have different commands and they take different time to execute. How can I save the start time like
09:00:00AM
file stream file stream file stream file stream
file stream file stream file stream file stream
.
.
.
file stream file stream file stream file stream
09:07:20AM
Note the start and end time stamp. It would be awesome if I could log the diff time
Total execution time: 00:07:20
Yes I can get the time using date command in cygwin,
$ date -> Tue, Mar 22, 2016 12:00:47 AM
but do I have to parse this date to get the time in variable and then take diff to get time elapsed?
time
to print timing statistics, eg.time python command.py 2>&1 | tee -a outFile.txt
. Useman time
for more info. I'm not sure if this is available oncygwin
.time ls
. What is the output? For me, it's something like this:file1 file 2 file3
real 0m0.003s
user 0m0.003s
sys 0m0.000s