Flex4之打印日志,比如某函数的开始和结束时间,用ms计算
2011-11-07 16:58
330 查看
有时候我们希望计算某个函数所经历的时间,比如一次打卡,刷卡所经历的时间,在这里,我们就需要统计其所花费的时间了。
首先统计出时间差,然后通过HttpService子对象send()至服务器保存。然后在服务器端打印输出来。
实现细节如下所示:
然后服务器端查看该日志,就可以知道所经历的时间了。
首先统计出时间差,然后通过HttpService子对象send()至服务器保存。然后在服务器端打印输出来。
实现细节如下所示:
startDate=new Date().getTime(); ........................................................ ................ ................ ................. .................. ................... ................................................. endDate=new Date().getTime(); //打印出日志 //trace("运行时间:\t"+(endDate-startDate).toString()); sendDataService.url = Properties.IP_valuse+Properties.DestAddressUrl +(endDate-startDate).toString() ; sendDataService.resultFormat="e4x"; sendDataService.useProxy=false; sendDataService.method="POST"; sendDataService.request="<log>{"+(endDate-startDate).toString()+"}</log>"; sendDataService.destination=""; sendDataService.send();
然后服务器端查看该日志,就可以知道所经历的时间了。
相关文章推荐
- .Net时间计算函数,统计某一天是一年的第几周,这一周从哪天开始到哪天结束
- .Net时间计算函数,统计某一天是一年的第几周,这一周从哪天开始到哪天结束
- .Net时间计算函数,统计某一天是一年的第几周,这一周从哪天开始到哪天结束
- 根据传入的时间,自动计算规则时间(如:包期时段的开始时间和结束时间)
- 计算两日期相差天数(用字符串格式的时间形式来比较)、将时间戳转为字符串,开始到结束的时间差(用时间戳来比较)
- 加班开始时间小于12点,加班结束时间大于13点,计算加班时间
- python计算程序开始到程序结束的运行时间和程序运行的CPU时间
- excel工作量清单计算开始、结束时间,自动跳过节假日
- iOS根据所得到的开始时间计算结束的时间
- oracle获取上一旬的开始时间和结束时间的实现函数
- 根据开始和结束时间,计算出该时间段每个星期的开始和结束时间
- Oracle日期周详解以及周开始结束时间计算
- Sql server 数据库中计算每天的开始结束时间
- 用js计算从开始到结束时间之内的按周值选定
- 转:Oracle日期周详解以及周开始结束时间计算
- python计算程序开始到程序结束的运行时间和程序运行的CPU时间
- python计算程序开始到程序结束的运行时间和程序运行的CPU时间
- 已知开始工作时间和工作日期计算工作日结束时间
- java根据开始时间结束时间计算中间间隔日期
- PHP获取指定月份的第一天开始和最后一天结束的时间戳函数