O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a Stopwatch Timer to Measure Code Execution Time

If you are working on a production application that will ship on the .NET Compact Framework platform, chances are you will be doing performance analysis on the application code. As this chapter is being written, the performance profiling tools on the market for the .NET Compact Framework are few and far between. Despite this lack of performance tools, there are some simple techniques that can be used to profile an application's performance traits.

First, it is important to have a reliable way to measure the execution time of a block of code. The .NET Compact Framework provides the TickCount property on the Environment class in the System namespace. This property can be used to calculate the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required