NEW!
CSHTML5 has now become OpenSilver!
We are happy to announce that CSHTML5 has been significantly improved and rebranded
to 'OpenSilver', which stands for 'Open-source reimplementation of Silverlight'. It is fully backward compatible and it can be downloaded from
OpenSilver.net. Upgrading from
CSHTML5 to OpenSilver is very easy.
Read the FAQ
For example, with Chrome, you can open the developer tools by pressing Ctrl+Shift+I. Then, click the Profiles tab, and click the round record button ("Start CPU profiling") located in the top-left corner of the developer tools. You can press F5 to reload the page. Then, press the round button again to stop the profiling. You can use the drop-down menu to switch between "Chart", "Bottom Up", and "Top Down" views.
Note: this feature requires C#/XAML for HTML5 version 1.0 Beta 11 or newer.
You can use the two following C# methods to measure the time spent in specific portions of your code:
Note: the time measured is "accrued", meaning that it is cumulative if the code is executed multiple times.
// Call the "StartMeasuringTime" method to start the stopwatch: var t0 = CSHTML5.Profiler.StartMeasuringTime(); // This is the code that we want to profile (ie. measure the time it takes to execute): List<string> list = new List<string>(); for (int i = 0; i < 10000; i++) { list.Add(i.ToString()); } // Call the "StopMeasuringTime" method to stop the stopwatch: CSHTML5.Profiler.StopMeasuringTime("Time it takes to execute a loop with 10000 items", t0);
The list of all the measurements will appear, together with the total time taken for each of them, the number of calls, and the average time per call.
You will also get a CSV-formatted output that is useful for copy/pasting into a spreadsheet application. This is how it works to copy/paste into a spreadsheet application while preserving the format of the data:
Please click here for contact information.