I have a WPF app based on MVVM pattern with Prism. We have a Shell and load the views as user control into the shell. The application contains menu based navigation as in, when you click a menu tool a screen will be loaded. I want to find out the time taken for the view to load. the time should be inclusive of the time taken to call a webservice, get the model data convert it into viewmodel and show the view. Is there any way do that? Is there any tool for that that is free?
Asked
Active
Viewed 264 times
1
-
whole process is on single thread? – D J Nov 09 '12 at 10:00
1 Answers
1
Use a StopWatch in your shell class. Start it when the user clicks a navigation item; add a Loaded
event listener to the new UserControl that you create, and stop the StopWatch there. That should give you the load time.

McGarnagle
- 101,349
- 31
- 229
- 260
-
1Just a heads up that Stopwatch class isn't extremely accurate http://stackoverflow.com/questions/394020/how-accurate-is-system-diagnostics-stopwatch , not sure if it matters in this case but the discussion on that thread lists a couple of alternatives. Dunno wich one is best most of the time Stopwatch is good enough for me :) – Iris Classon Feb 24 '13 at 02:06