在批处理文件打印时间(毫秒) [英] Print time in a batch file (milliseconds)

查看:274
本文介绍了在批处理文件打印时间(毫秒)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何打印时间(毫秒)在Windows批处理文件?

How do I print the time (in ms) in a Windows batch file?

我想衡量,在我的批处理文件行之间经过的时间,但Windows的时间/ T不打印毫秒。

I want to measure the time that passes between lines in my batch file, but Windows's "time /T" does not print milliseconds.

推荐答案

%TIME%应该工作,提供了足够的时间调用之间经过:

%time% should work, provided enough time has elapsed between calls:

@echo OFF

@echo %time%
ping -n 1 -w 1 127.0.0.1 1>nul
@echo %time%

在我的系统上得到以下的输出:

On my system I get the following output:

6:46:13.50

   6:46:13.60

6:46:13.50
6:46:13.60

这篇关于在批处理文件打印时间(毫秒)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆