<?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%3Aasin185</id>
	<title>SE250:lab-1:asin185 - 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%3Aasin185"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-1:asin185&amp;action=history"/>
	<updated>2026-04-29T04:54:50Z</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:asin185&amp;diff=4240&amp;oldid=prev</id>
		<title>Mark: 5 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-1:asin185&amp;diff=4240&amp;oldid=prev"/>
		<updated>2008-11-03T05:18:39Z</updated>

		<summary type="html">&lt;p&gt;5 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Lab One =&lt;br /&gt;
&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
-The work for lab one was quite easy but i needed some help to get started as i havnt done this for a while. After a while, just looking at the screen i got into it.We looked at the  time taken to execute sereval addition loops by using thr &amp;quot;clock()&amp;quot; function. We took one hundred million as the standard value for testing the different data types.&lt;br /&gt;
&lt;br /&gt;
-First we had to create a main class to carry all the methods.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;time.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 void main (){}&lt;br /&gt;
&lt;br /&gt;
-Then we Initialised the variable for the different data types and put them trough the loop to see how long it would take to  - exectue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 int &amp;#039;&amp;#039;&amp;#039;result&amp;#039;&amp;#039;&amp;#039; = 0;&lt;br /&gt;
 long t = clock();&lt;br /&gt;
 &lt;br /&gt;
 for(int i = 0; i &amp;lt; 100000000 ; i++){&lt;br /&gt;
 	result ++;&lt;br /&gt;
 	}&lt;br /&gt;
 	t = clock() - t;&lt;br /&gt;
 	printf(&amp;quot;%ld&amp;quot;,t);&lt;br /&gt;
 &lt;br /&gt;
Then changing the  &amp;#039;&amp;#039;&amp;#039;result&amp;#039;&amp;#039;&amp;#039; to all the different data types like ( int , long, short, float, double).&lt;br /&gt;
== Results ==&lt;br /&gt;
Results are as follows for the amount of time taken to execute the loop 100,000,000 times. An average was taken from all the graphs after 10 trails for each data type.&lt;br /&gt;
&lt;br /&gt;
Int    = 307.7 &lt;br /&gt;
Long   = 309.4&lt;br /&gt;
Short  = 314.6&lt;br /&gt;
Float  = 444.9&lt;br /&gt;
Double = 442.6&lt;br /&gt;
&lt;br /&gt;
[[Image:int.jpg]]&lt;br /&gt;
[[Image:long.jpg]]&lt;br /&gt;
[[Image:Short.jpg]]&lt;br /&gt;
[[Image:float.jpg]]&lt;br /&gt;
[[Image:double.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
As you can see the the int takes the least amount of time as it is quite round and the others follow&lt;br /&gt;
on after the the int.After the main layout was done then it was just a matter of changing the data &lt;br /&gt;
type and recording it. Problems occured as the values varied to much and time of the data types didnt have any trend.I think i may need to practice more C programing after this lab.&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>