这个问题在这里已经有答案了:
在java中继续之前等待进程完成(4个答案)
如何在java中测量所用的时间[重复](15个答案)
上个月关门了。
有没有办法知道命令的执行时间?制作 exec
同步
Runtime rt = Runtime.getRuntime();
Process process = rt.exec(ffmpeg +" -i "+source+" -vcodec h264 -acodec aac "+destination);
ffmpeg命令需要一些时间,所以我想在执行之后记录一些内容。有没有办法在命令执行后记录这些事情?
1条答案
按热度按时间e0bqpujr1#
您可以记录进程开始前的时间,等待它完成,然后再次记录时间,并减去这两个时间: