在windws下模拟Linux下可获取命令执行时间的time命令
时间:2023-11-21 02:01:27
Linux 下的 time 命令可以获取命令执行时间,Windows 下并没有类似的命令,我们可以自力更生写一个批处理模拟实现下可获取命令执行时间的time命令,感兴趣的朋友不要错过了Linux 下的 time 命令可以获取命令执行时间,Windows 下并没有类似的命令,我们可以自力更生写一个批处理,命名为time.bat。
[plain]
@echo off
set /a StartMS=%time:~3,1%*60000 + %time:~4,1%*6000 + %time:~6,1%*1000 + %time:~7,1%*100 + %time:~9,1%*10 + %time:~10,1%
%1 %2 %3 %4 %5 %6
set /a EndMS =%time:~3,1%*60000 + %time:~4,1%*6000 + %time:~6,1%*1000 + %time:~7,1%*100 + %time:~9,1%*10 + %time:~10,1%
set /a realtime = %EndMS%-%StartMS%
echo %realtime%ms
这是执行的例子,测试PHP 5.3、5.4、5.5 不同版本的运行速度:
[plain]
F:\BAK>time.bat F:\BAK\php-5.3.27\php.exe primes.benchmark.php
PHP version 5.3.27
Found 148933 prime numbers.
867ms
F:\BAK>time.bat F:\BAK\php-5.4.19\php.exe primes.benchmark.php
PHP version 5.4.19
Found 148933 prime numbers.
759ms
F:\BAK>time.bat F:\BAK\php-5.5.4\php.exe primes.benchmark.php
PHP version 5.5.4
Found 148933 prime numbers.
733ms
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10系统玩辐射4不能全屏怎么办 辐射4设置全屏的方法
如何在EXCEL中打勾
Win10多彩边框主题包FlattasDark/Flattastic下载
![](https://img.aspxhome.com/file/2023/28/a248339_0s.jpg)
Win10哪些补丁会导致电脑蓝屏?
![](https://img.aspxhome.com/file/2023/1/a277635_0s.png)
如何解决win10ie主页修改了无效的问题
![](https://img.aspxhome.com/file/2023/4/a306436_0s.png)
PPT如何制作三线式封面?PPT制作三线式封面教程
![](https://img.aspxhome.com/file/2023/10/a350339_0s.png)
Win10系统锁定IE浏览器主页的方法
![](https://img.aspxhome.com/file/2023/5/a316212_0s.jpg)
如何在wps表单中将两页变成一页?
Win11脸部识别登入如何更新?Win11脸部识别更新步骤
![](https://img.aspxhome.com/file/2023/27/a237676_0s.png)
Epic无法使用Steam登录怎么办?Epic无法使用Steam登录的解决方法
![](https://img.aspxhome.com/file/2023/7/a328477_0s.jpg)
win7系统屏蔽win键的操作方法
![](https://img.aspxhome.com/file/2023/5/a314268_0s.jpg)
WPS文档漫游怎么用?
![](https://img.aspxhome.com/file/2023/5/a164465_0s.jpg)
Win10专业版Steam平台打不开怎么办?
![](https://img.aspxhome.com/file/2023/4/50414_0s.jpg)
wps ppt如何更换背景
Windows7快速删除系统垃圾文件BAT脚本分享
![](https://img.aspxhome.com/file/2023/29/a253856_0s.jpg)
Win10笔记本电脑怎么打开摄像头?
![](https://img.aspxhome.com/file/2023/26/a220363_0s.jpg)
在word文档中如何无格式黏贴?两种无格式黏贴方法
![](https://img.aspxhome.com/file/2023/6/24276_0s.jpg)
2022Win11 22H2极速流畅版系统下载(极致丝滑)
![](https://img.aspxhome.com/file/2023/27/a234603_0s.jpg)
Windows7创建的电源计划怎么清除?
![](https://img.aspxhome.com/file/2023/27/a233356_0s.jpg)
Win7待机设置的方法 Win7怎么设置不待机
![](https://img.aspxhome.com/file/2023/27/a232635_0s.jpg)