2017-07-03 24 views
0

我有一个.exe文件从芯片下载数据。 我想知道开始时间退出时间这个程序,使用.bat文件,但我不知道如何做到这一点。蝙蝠文件的开始和退出时间

请帮帮我!

感谢

+2

[?如何衡量在Windows命令行命令的执行时间(HTTPS的可能重复://计算器。 com/questions/673523/how-to-measure-execution-time-of-command-in-windows-command-line) – aschipfl

回答

0

如果yourexecutable滚动/页开始的时间出入画面时我宁愿:

Set StartTime=%time% 
ECHO start: %StartTime% 
yourexecutable 
Set EndTime=%time% 
Echo start: %StartTime% 
Echo end : %EndTime% 
Echo Yourexecutable ran form %StartTime% to %EndTime% >>"YourExe.Log" 
Pause 
+0

非常感谢您的回答!如果我想将打印的时间保存在文件.txt中,也可能是start_time和end_time之间的区别,我该怎么办?可能吗?谢谢 – user8247372

+0

我添加了日志记录到上面的批处理,因为时间差已经存在[Q&A for this](https://stackoverflow.com/questions/9922498/calculate-time-difference-in-windows-batch-file) – LotPings

3
ECHO start: %time% 
yourexecutable 
echo end : %time% 

是我会做到这一点。

+0

谢谢你的回答! 如果我想在文件.txt中保存一个打印的时间,也许还有start_time和end_time之间的差异,我该怎么办?可能吗? 谢谢 – user8247372