JavaScript 判断网络丢包率并提示
var packetLoss = 0.5; // 丢包率,单位为百分比
if (packetLoss === 0) { console.log('丢包率为0%,正常'); } else if (packetLoss > 0 && packetLoss < 100) { console.log('丢包率为' + packetLoss + '%,警告'); } else if (packetLoss === 100) { console.log('丢包率为100%,异常,请继续优化'); } else { console.log('丢包率输入错误,请重新输入'); }
AI 优化版
原文地址:https://www.cveoy.top/t/topic/lrNF 著作权归作者所有。请勿转载和采集!