小弟如果直接在command line下列指令:
(time ./a.out) >> test.log
可以把執行./a.out的輸出與其執行時間輸出到test.log這個檔
ex.
./a.out會輸出 Hello World
則test.log裡面的內容會是
Hello World
0.000u 0.001s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
但是同樣在run.sh檔中打
(time ./a.out) >> test.log
執行./run.sh後,test.log裡面的內容卻只有
Hello World
執行時間的資訊不會出現在test.log裡面,而是出現在command line上
而且格式變成
real 0m0.004s
user 0m0.001s
sys 0m0.000s
請問我指令要怎麼在run.sh寫,才能讓test.log這個檔裡面有執行時間的資訊
而且格式是
real 0m0.004s
user 0m0.001s
sys 0m0.000s
這樣子呢?
困擾好久了
一直都試不出來 @@
麻煩高手幫幫忙囉
感激呀
--
(time ./a.out) >> test.log
可以把執行./a.out的輸出與其執行時間輸出到test.log這個檔
ex.
./a.out會輸出 Hello World
則test.log裡面的內容會是
Hello World
0.000u 0.001s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
但是同樣在run.sh檔中打
(time ./a.out) >> test.log
執行./run.sh後,test.log裡面的內容卻只有
Hello World
執行時間的資訊不會出現在test.log裡面,而是出現在command line上
而且格式變成
real 0m0.004s
user 0m0.001s
sys 0m0.000s
請問我指令要怎麼在run.sh寫,才能讓test.log這個檔裡面有執行時間的資訊
而且格式是
real 0m0.004s
user 0m0.001s
sys 0m0.000s
這樣子呢?
困擾好久了
一直都試不出來 @@
麻煩高手幫幫忙囉
感激呀
--
All Comments