在 Flex 中,有没有办法确定 HTTPService.send() 调用往返需要多长时间? [英] In Flex, is there a way to determine how long an HTTPService.send() call takes round-trip?

查看:24
本文介绍了在 Flex 中,有没有办法确定 HTTPService.send() 调用往返需要多长时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望找出并跟踪到服务器的往返行程需要多长时间.只是有点好奇.

I am looking to find out and track how long a round-trip to the server is taking. Just kinda curious more than anything.

推荐答案

设置几个变量并将 .send() 调用之前的时间存储在一个中,并将结果函数开头的时间存储在另一个中.这些时间的差异应该是您获取数据的总时间.

set up a couple variables and store the time right before the .send() is called in one and store the time at the beginning of the result function in another. The difference of those times should be your total time to get the data.

我今天必须这样做才能查看函数运行了多长时间.

I had to do this today to see how long a function was running.

我声明了这个

private var start:Number = 0;
private var end:Number = 0;

这是我开始计时

start = new Date().time;

到此结束

end = new Date().time;
Alert.show((end-start).toString());

这篇关于在 Flex 中,有没有办法确定 HTTPService.send() 调用往返需要多长时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆