In Flex, is there a way to determine how long an HTTPService.send() call takes round-trip?

百般思念 提交于 2019-12-25 03:38:17

问题


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


回答1:


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.

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

I declared this

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

This at the beginning of what I was timing

start = new Date().time;

This at the end of it

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


来源:https://stackoverflow.com/questions/1883668/in-flex-is-there-a-way-to-determine-how-long-an-httpservice-send-call-takes-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!