C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 01-30-2003, 10:02 PM   #1
-zc3-
Guest
 
Posts: n/a
Timing algorithms

How would I alter my makefile or make a shellscript that will run, compile and record the times for my program. I want to time them to compare results.
  Reply With Quote
Old 01-31-2003, 02:47 PM   #2
Registered User
 
Join Date: Aug 2002
Location: Hermosa Beach, CA
Posts: 446
Try:

timex yourprogramname.exe

Im not sure if there is a man page for timex or not, maybe you can search the net for info. I believe it prints user time, kernel time, & combined time to stdout after your program has exited.
__________________
The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.
IfYouSaySo is offline   Reply With Quote
Old 01-31-2003, 05:15 PM   #3
Microsoft. Who?
 
MethodMan's Avatar
 
Join Date: Mar 2002
Posts: 1,198
Not sure how to actually compute the time, but you can using something called big O notation.

It calculates the theorictal time/space of algorithms.
__________________
-MethodMan-

Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

Homepage: http://www.freewebs.com/andy_moog/home.html
MethodMan is offline   Reply With Quote
Old 02-26-2003, 12:08 AM   #4
Registered User
 
Join Date: Dec 2002
Posts: 19
yes, with the big O notation you can compute several things, not only the time needed for the program.

BUT: you donīt get "this takes 30 seconds" but you get something like "your program is in O(nē)"... so, the O notation depends on a variable, or two or even more... and i think the author of this thread wants to get the real time!

wudmx
wudmx is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting algorithms, worst-case input Leftos C++ Programming 17 06-15-2009 01:33 PM
My Timing System jmd15 Windows Programming 4 01-01-2006 11:43 PM
Timing in Windows steinberg Windows Programming 3 07-14-2002 12:43 AM
relative strength of encryption algorithms (blowfish, des, rinjdael...) duck-billed platypus A Brief History of Cprogramming.com 3 12-30-2001 04:20 PM


All times are GMT -6. The time now is 01:13 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22