<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DotBert &#187; Stopwatch</title>
	<atom:link href="http://dotbert.loedeman.nl/category/stopwatch/feed" rel="self" type="application/rss+xml" />
	<link>http://dotbert.loedeman.nl</link>
	<description>.NET thoughts by Bert Loedeman</description>
	<lastBuildDate>Thu, 18 Mar 2010 12:49:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Logging duration with System.Diagnostics.StopWatch instead of using DateTime.Now</title>
		<link>http://dotbert.loedeman.nl/logging-duration-with-systemdiagnosticsstopwatch-instead-of-using-datetimenow</link>
		<comments>http://dotbert.loedeman.nl/logging-duration-with-systemdiagnosticsstopwatch-instead-of-using-datetimenow#comments</comments>
		<pubDate>Fri, 09 Jan 2009 13:14:00 +0000</pubDate>
		<dc:creator>Bert Loedeman</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Stopwatch]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[duration logging]]></category>

		<guid isPermaLink="false">http://www.loedeman.net/wordpress/?p=27</guid>
		<description><![CDATA[Still using two DateTime.Now calls to determine the duration of a certain call execution, like beneath?

DateTime start = DateTime.Now;
DoSomeCall();
double secondsToLog = (DateTime.Now - start).TotalSeconds;

This is not at all necessary: using the StopWatch class. The StopWatch class is more efficient than any other solution provided or created in .NET since it uses low-level API calls and [...]]]></description>
			<content:encoded><![CDATA[<p>Still using two DateTime.Now calls to determine the duration of a certain call execution, like beneath?</p>
<pre class="brush: csharp;">
DateTime start = DateTime.Now;
DoSomeCall();
double secondsToLog = (DateTime.Now - start).TotalSeconds;
</pre>
<p>This is not at all necessary: using the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx">StopWatch</a> class. The StopWatch class is more efficient than any other solution provided or created in .NET since it uses low-level API calls and supports a high-resolution performance counter (when there is hardware and software support).</p>
<pre class="brush: csharp;">
Stopwatch watch = new Stopwatch();
watch.Start();
DoSomeCall();
watch.Stop();
double secondsToLog = watch.Elapsed.TotalSeconds;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://dotbert.loedeman.nl/logging-duration-with-systemdiagnosticsstopwatch-instead-of-using-datetimenow/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
