<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-1%3Ahbar055</id>
	<title>SE250:lab-1:hbar055 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-1%3Ahbar055"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-1:hbar055&amp;action=history"/>
	<updated>2026-04-28T21:23:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:lab-1:hbar055&amp;diff=4301&amp;oldid=prev</id>
		<title>Mark: 3 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-1:hbar055&amp;diff=4301&amp;oldid=prev"/>
		<updated>2008-11-03T05:18:41Z</updated>

		<summary type="html">&lt;p&gt;3 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This program measures how long it would take for the (+) operation to run for 10 million times (using y++). The program contained a &amp;quot;for Loop&amp;quot; which helped to give an appropriate time.&lt;br /&gt;
&lt;br /&gt;
The procedure for this program is as follows:&lt;br /&gt;
 &lt;br /&gt;
* First i used the &amp;#039;clock_t t0 = clock();&amp;#039; to record the time at present time.&lt;br /&gt;
&lt;br /&gt;
* Then a for loop was used to loop 10 million times just using the (+) operator.&lt;br /&gt;
&lt;br /&gt;
* The line &amp;#039;printf( &amp;quot;%ld\n&amp;quot;, clock() - t0 );&amp;#039; just took the present time after the operation in the for Loop and subtracted it by the time before the for Loop operation.&lt;br /&gt;
&lt;br /&gt;
A few problems came up in the making of this program. The program gave 0 continuously in its execution, this was because the number of loops was too few for the computer to give a proper time record. The result finally gave a proper number of an average of 35ms.&lt;br /&gt;
&lt;br /&gt;
In trying different operations and different types the result gave different values, the result of some of these changes are given as follows:&lt;br /&gt;
&lt;br /&gt;
* Using &amp;#039;double y&amp;#039; gave a slower sped of about 75ms&lt;br /&gt;
* Using &amp;#039;double x&amp;#039; gave a slower speed of about 60ms&lt;br /&gt;
* Using &amp;#039;y--&amp;#039; gave the same average speed as y++&lt;br /&gt;
* Using &amp;#039;float y&amp;#039; gave a slower sped of about 50ms&lt;br /&gt;
* Using &amp;#039;float x&amp;#039; gave a slower speed of about 60ms&lt;br /&gt;
* Using &amp;#039;long y&amp;#039; gave a slower speed of about 35ms&lt;br /&gt;
* Using &amp;#039;long x&amp;#039; gave a slower speed of about 60ms&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>