<div id="IMContentTest">
<textarea name="IMContent" class="IMClass" style="color:#ff0000;width:510px; height: 50px;" id="Textarea0"></textarea>
<textarea name="IMContent" class="IMClass" style="color:#ff0000;width:510px; height: 50px;" id="Textarea1"></textarea><br/><br/>
<textarea name="IMContent" class="IMClass" style="color:#ff0000;width:510px; height: 50px;" id="Textarea2"></textarea><br/><br/>
<textarea name="IMContent" class="IMClass" style="color:#ff0000;width:510px; height: 50px;" id="Textarea3"></textarea><br/><br/>
<textarea name="IMContent" class="IMClass" style="color:#ff0000;width:510px; height: 50px;" id="Textarea4"></textarea>
</div>
       //变量定义
var testflag = 0, t, sipaccount, fruency, count = 0, se1, se2, m = 0, h = 0, s = 0, ss = 1;
var testcontent
//时、分、秒、毫秒的计算
function second(showtimeTag) { if ((ss % 100) == 0) {
s += 1; ss = 1;
}
if (s > 0 && (s % 60) == 0) {
m += 1; s = 0;
}
if (m > 0 && (m % 60) == 0) {
h += 1; m = 0;
}
document.getElementById(showtimeTag).value = h + "时" + m + "分" + s + "秒";
ss += 1;
} var ImContentList = "";
//获得一个0到4的随机整数
function getNumber() {
var random = 4 * Math.random();
if (!isNaN(random) && isFinite(random)) {
return parseInt(random);
}
}
//发送消息动作
function sendmessage() {
var IMContents = $(".IMClass"); $(IMContents).each(function () {
if ($(this).attr("value") != undefined)
ImContentList += $(this).attr("value") + ",";
});
ImContentList = ImContentList.substr(0, ImContentList.length - 1);
var contentlist = ImContentList.split(',');
var numb = getNumber();
var content = contentlist[numb];
//document.forms[0].forms[0].elements[parseInt(5 * Math.random())].value
testcontent = "[" + sip + "]" + " [ " + count + " ]" + "[ " + h + "时" + m + "分" + s + "秒" + " ] " + " " + content; count++;
} //开始测试
function starttest(showtimeTag) {
var time = parseInt(document.getElementById("secondText").value) * 1000;
var temp1 = "second(\"" + showtimeTag + "\")";
var temp2 = "sendmessage()";
se1 = self.setInterval(temp1, 10);
se2 = self.setInterval(temp2, time);
}
//暂停测试
function pausetest() {
window.clearInterval(se1);
window.clearInterval(se2);
}
//停止测试
function stoptest() {
window.clearInterval(se1);
window.clearInterval(se2);
testflag = 0;
ss = 1;
m = h = s = 0;
document.getElementById("showtime").value = "0时0分0秒";
}

最新文章

  1. file-max与ulimit的关系与差别
  2. WordPress用户注册无法发送密码邮件怎么回事?
  3. 生成一行html
  4. 跟我一起学WCF(5)——深入解析服务契约[上篇]
  5. BZOJ4060 : [Cerc2012]Word equations
  6. varnish中忽略cookie进行缓存
  7. JavaScript算法题之–随机数的生成
  8. 【测试】这是用微软word发布的博客
  9. Android中TextView中内容不换行的解决方法
  10. 阐述linux IPC(五岁以下儿童):system V共享内存
  11. ES 6 : 变量的解构赋值
  12. visualSFM的使用方法
  13. WPF笔记1 用VS2015创建WPF程序
  14. (一)ROS系统入门 Getting Started with ROS 以Kinetic为主更新 附课件PPT
  15. Codeblock代码提示自动补全(包括结构体成员)
  16. 【Luogu2197】NIM游戏(博弈论)
  17. IPAddress.Any 解决本地ip和服务器ip切换问题
  18. 15.5.26-linq to ef多级外链查询
  19. CentOS7安装OpenStack(Rocky版)-07.安装horizon服务组件(控制节点dashboard)
  20. WPF 带CheckBox、图标的TreeView(转)

热门文章

  1. MarkDown基础语法大全
  2. 2、kvm基础常用命令操作
  3. CMD当前代码页修改
  4. SpringBoot源码篇:深度分析SpringBoot如何省去web.xml
  5. Xpath定位绝密版本
  6. window.open 打开Excel或者Word 无权限问题
  7. 批量 多个JPG生产PDF .net C#
  8. 前端-页面性能调试:Hiper
  9. KBEngine warring项目源码阅读(三) 实体文件与Account处理
  10. 动态页面技术----EL技术、JSTL技术,javaEE的开发模式