<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>IDisposable on Bits and Pieces</title>
		<link>https://bits.strawjackal.org/tags/idisposable/</link>
		<description>Recent content in IDisposable on Bits and Pieces</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Wed, 30 Oct 2013 13:27:52 +0200</lastBuildDate>
		
			<atom:link href="https://bits.strawjackal.org/tags/idisposable/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Quick and Dirty Code Timing</title>
				<link>https://bits.strawjackal.org/73/</link>
				<pubDate>Wed, 30 Oct 2013 13:27:52 +0200</pubDate>
				<guid>https://bits.strawjackal.org/73/</guid>
				<description>&lt;p&gt;When looking to optimize our code, the first and best advice we should keep in mind is this: Measure. Don’t optimize before you know what takes time, and then only optimize where it makes sense. &lt;/p&gt; &lt;p&gt;Measuring can be done in many ways. Using Performance Counters, high-performance timers and stress tests. But often, especially in early iterations, we just want to get a ballpark figure for how long a bit of code takes. Maybe a low-level database call that gets used a lot, maybe as a wrapper in our initialization code to know what should be moved to lazy evaluation. In those cases, the quickest approach is to simply use .NET’s System.Diagnostics.Stopwatch class. Start it, stop it, and print out the timing.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
