[Ilugc] Calculation of execution time

  • From: krishnancbalak@xxxxxxxxxxx (Balakrishnan Chandrasekaran)
  • Date: Wed, 17 Mar 2004 22:40:29 +0530

There is a facility in C, provided the structure "clock_T" is supported in 
linux also.
sample code:
clock_t start, end;
start = clock();
\\instruction
end = clock ();
printf ("time taken for the instruction: %f \n", (start - end) /CLK_TCK);
//CLK_TCK is a constant

ciao,
Krishnan C Balak


From: shekar <shekharchn@xxxxxxxxx>
To: lk lkj <ilugc@xxxxxxxxxxxxxxxxxx>
Subject: [Ilugc] Calculation of execution time
Date: Wed, 17 Mar 2004 02:28:59 -0800 (PST)


 I am reading data from a parallel port. where right
now i neglected the ack part. iam simply reading the
data from port . i hv routine which inside program
counts no of times it read. but i want to do the same
for only one sec.

     is there any syscall in linux will help to run
the particular code for stipulated period of time .
      or else how to know the execution time of on
instruction(c language -statement) in linux.

-shekar

__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
_______________________________________________
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx with
"unsubscribe <password> address"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

_________________________________________________________________
Protect your PC from viruses. Get in the experts. 
http://www.msn.co.in/pcsafety/ Click here now!


Other related posts: