<?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%3Ahlin079</id>
	<title>SE250:lab-1:hlin079 - 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%3Ahlin079"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-1:hlin079&amp;action=history"/>
	<updated>2026-04-29T02:15:47Z</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:hlin079&amp;diff=4305&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:hlin079&amp;diff=4305&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;i started with an empty project and a new file. i wrote the for loop. but i found that i don&amp;#039;t know how to use the clock function for the timing. so i went on internet search for the clock function.then i wrote my code. but i forgot to declared the type for the time 1 and time 2. also i was thinking that the clock funtion will give the time with out me write some code find out the time1 and time2. after the build project i find out that i need to put the clk1=clock();before my for loop so when the pc start the for loop they find out the time at that instant.also i put the clk2=clock();after my for loop to count the time taken to finish the loop.  i set my i maxmum to &amp;gt;1000 and i got 0 second. i think i got o sec becouse that my &amp;quot;i&amp;quot; was too small. so i changed my i to &amp;gt; 1000000000,for that i got 3.123 .&lt;br /&gt;
 my code`\&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
int main(){&lt;br /&gt;
int i;&lt;br /&gt;
 clock_t clk1;&lt;br /&gt;
clock_t clk2;&lt;br /&gt;
double time;&lt;br /&gt;
&lt;br /&gt;
clk1=clock();&lt;br /&gt;
for (i=0;i&amp;lt;1000000000;i++){&lt;br /&gt;
	i=i+1;}&lt;br /&gt;
clk2=clock();&lt;br /&gt;
time=(clk2-clk1)/(double) CLOCKS_PER_SEC;&lt;br /&gt;
&lt;br /&gt;
printf(&amp;quot;processing %d addition takes %f&amp;quot;,i,time);&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>