Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 批处理文件ping-t命令_Batch File_Ping - Fatal编程技术网

Batch file 批处理文件ping-t命令

Batch file 批处理文件ping-t命令,batch-file,ping,Batch File,Ping,我正在制作一个批处理文件,以查找ping-t的平均时间。如何从ping输出中提取时间。从下面的代码中,您将得到一些提示 SET CONNECT=YES PING google.com | FIND "time=" > NUL IF ERRORLEVEL 1 SET CONNECT=NO ECHO You have %CONNECT% active connection to the Internet “你有“是的”活动连接”?@AdamLiss:当你只想得到一些提示时,你不应该试图逐字解

我正在制作一个批处理文件,以查找ping-t的平均时间。如何从ping输出中提取时间。

从下面的代码中,您将得到一些提示

SET CONNECT=YES
PING google.com | FIND "time=" > NUL
IF ERRORLEVEL 1 SET CONNECT=NO
ECHO You have %CONNECT% active connection to the Internet

“你有“是的”活动连接”?@AdamLiss:当你只想得到一些提示时,你不应该试图逐字解释答案谢谢,但是你能把这个数字设为变量吗?@AndriyM:你刚刚面试失败,成千上万的潜在雇主(和客户)都在关注着你
SET CONNECT=an
将代码转换为用户可使用的解决方案,只需额外考虑一点点,代码更少。细节将平庸的程序员与优秀的程序员区分开来。你们两个能不能把时间以毫秒为单位存储为变量!