<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Get time difference in microtime in C	</title>
	<atom:link href="https://www.binarytides.com/get-time-difference-in-microtime-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.binarytides.com/get-time-difference-in-microtime-in-c/</link>
	<description>News, Technology, Entertainment and more</description>
	<lastBuildDate>Wed, 18 Apr 2012 14:33:17 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>
		By: Toby Speight		</title>
		<link>https://www.binarytides.com/get-time-difference-in-microtime-in-c/comment-page-1/#comment-65279</link>

		<dc:creator><![CDATA[Toby Speight]]></dc:creator>
		<pubDate>Wed, 18 Apr 2012 14:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=1417#comment-65279</guid>

					<description><![CDATA[That&#039;s really not the best way to do it, as you lose precision by forming two doubles and subtracting them.  Much better to do the subtraction of timevals (using the BSD timersub() function if you have it) and then create a double from the result.  If you don&#039;t have timersub(), try

double timediff = (y.tv_sec - x.tv_sec) + 1e-6 * (y.tv_usec - x.tv_usec); /* in seconds */

And certainly don&#039;t cast x_ms and y_ms to double - a cast is a warning of something that requires greater scrutiny, and over-using is like crying wolf - if it&#039;s all over the place, it loses its shock value.]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s really not the best way to do it, as you lose precision by forming two doubles and subtracting them.  Much better to do the subtraction of timevals (using the BSD timersub() function if you have it) and then create a double from the result.  If you don&#8217;t have timersub(), try</p>
<p>double timediff = (y.tv_sec &#8211; x.tv_sec) + 1e-6 * (y.tv_usec &#8211; x.tv_usec); /* in seconds */</p>
<p>And certainly don&#8217;t cast x_ms and y_ms to double &#8211; a cast is a warning of something that requires greater scrutiny, and over-using is like crying wolf &#8211; if it&#8217;s all over the place, it loses its shock value.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
