Time taken to load a contrl
-
Hi whats the accurate and best method to get the time taken to load a control.?.Any idea ?.(I am writing a performance monitoring UI test.) With thanxx and regards
-
Hi whats the accurate and best method to get the time taken to load a control.?.Any idea ?.(I am writing a performance monitoring UI test.) With thanxx and regards
I think to get a good answer to this question you need to tell us exactly what you mean by "load a control." Are you talking about how long it takes to "fill" a databound object, like a ListView, with thousands of rows from its source ? Are you talking about how long it takes, from the time an end-user double-clicks on a compiled .NET .exe file to present a Window (WPF, WinForms ?) with many controls ... the contents/settings of which ... all (or some) ... need to be calculated when the application launches, rather than being "static," or read in from Application.Settings or other resources ?
"It is the mark of an educated mind to be able to entertain a thought without accepting it." Aristotle
-
Hi whats the accurate and best method to get the time taken to load a control.?.Any idea ?.(I am writing a performance monitoring UI test.) With thanxx and regards
-
Hi whats the accurate and best method to get the time taken to load a control.?.Any idea ?.(I am writing a performance monitoring UI test.) With thanxx and regards
Use the
StopWatch
class, callStart()
right before andStop()
right after the execution of the code you're interested in. I don't know what you mean by "load a control"; with all the events going on in a WinForms Form when opening up a new Form, it may well be that your control is touched in the Form's constructor, and several event handlers such asLoad
andShown
. And that other controls also get handled at around the same time. You might even have to deal with an extra Control which you handle all at once, using your own run-time code only. Warning: if lots of data is loaded into the control (such as a DataGridView fed by a database), how you organize the data load will predominate, not the generating and painting of the control itself; unless you have coded a large number of operations on a single control and you've forgotten to make good use of optimizing calls such asControl.SuspendLayout()
and the like. :)Luc Pattyn [My Articles] Nil Volentibus Arduum
-
Hi whats the accurate and best method to get the time taken to load a control.?.Any idea ?.(I am writing a performance monitoring UI test.) With thanxx and regards