Thread: Timing algorithms

  1. #1
    -zc3-
    Guest

    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.

  2. #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.

  3. #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

  4. #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

Popular pages Recent additions subscribe to a feed

Similar Threads

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