@echo off
setlocal enabledelayedexpansion
set Received=0
set Sent=0
oop
for /f "tokens=1,2" %%a in ('wmic path Win32_PerfRawData_Tcpip_TCPv4 get SegmentsReceivedPersec^,SegmentsSentPersec^|findstr "[0-9]"') do (
set /a ReceivedPerSecond=%%a-!Received!
set /a SentPerSecond=%%b-!Sent!
set Received=%%a
set Sent=%%b
)
echo 接收:%ReceivedPerSecond% KB/s
echo 发送:%SentPerSecond% KB/s
timeout 1 >nul
goto Loop作者: 29943270 时间: 2021-9-22 13:52