开发者

how to measure the page time load?

开发者 https://www.devze.com 2023-02-05 22:50 出处:网络
I want to know how much time a speci开发者_运维问答fic code in my App takes ?!!! Thank you You could use the Stopwatch class:

I want to know how much time a speci开发者_运维问答fic code in my App takes ?!!! Thank you


You could use the Stopwatch class:

var watch = Stopwatch.StartNew();
// Run your code here
watch.Stop();
long milliseconds = watch.ElapsedMilliseconds; 


Aside from @Darins answer you won't be able to measure page load time on the client as they are across a network and there are many variables involved (i.e. You can start a javascript timer as the page would need loaded first). However anything on the server can be timed.

0

精彩评论

暂无评论...
验证码 换一张
取 消