The Artima Developer Community
Sponsored Link

.NET Buzz Forum
SnippetCompiler + StopWatch = Good

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Watermasysk

Posts: 661
Nickname: scottwater
Registered: Aug, 2003

Scott Watermasysk is an ASP.NET developers. He wrote the .Text blog engine.
SnippetCompiler + StopWatch = Good Posted: Sep 5, 2003 9:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Scott Watermasysk.
Original Post: SnippetCompiler + StopWatch = Good
Feed Title: ScottW's ASP.NET WebLog
Feed URL: /error.aspx?aspxerrorpath=/blog/rss.aspx
Feed Description: ASP.NET and Blogging
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Scott Watermasysk
Latest Posts From ScottW's ASP.NET WebLog

Advertisement

I am really liking Jeff Key's SnippetCompiler. Its not "official" testing, but I like doing quick timing tests with it. Since these tests are small, its important to have an accurate time interval.  In the past if have used Mentalis.org's StopWatch class.

The .NET framework provides several ways to measure time intervals; you can use the DateTime.Now property or the Environment.TickCount property. However, these methods are not very precise. In fact, the Environment.TickCount can have a worst case resolution of 500 milliseconds. If you need to measure short time intervals, these methods may not be good options.[Mentalis.org]

So I quickly whipped up a snippet template which also contains a comment free version of the the StopWatch class. You can grab it here, if you are interested. Just remove the .txt and drop it in the template folder.

To use:
StopWatch sw = new StopWatch();
//Run your test
sw.Write(”My test took:”);

Read: SnippetCompiler + StopWatch = Good

Topic: Now Playing: TRON 2.0 Previous Topic   Next Topic Topic: Longhorn Schedule and Licensing Impacts

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use