Thread: running time

  1. #1
    Unregistered
    Guest

    Question running time

    how can be the running time calculated of a function ?what will be the header file?

  2. #2
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    you can use ftime. and the timeb structure. in time.h
    hasafraggin shizigishin oppashigger...

  3. #3
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Do you mean actual time? Or the concept of complexity analysis (Big O)?
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  4. #4
    Unregistered
    Guest

    actyal

    i want to calculate actual run time.

  5. #5
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    If you are on a windows os including a console program then go to msdn and search for QueryPerformanceCounter()
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  6. #6
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459

    ahem... [hasafraggin cookies]

    strickly speaking, ftime wouldn't actually give you the runtime of a function [as if you put the the function's address as a parameter]. but rather it's such that you'd get the runtime of the processor since 1980, which you could poll twice and take the difference at both ends of your function's execution.
    hasafraggin shizigishin oppashigger...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Finding Program Running Time
    By pf732k3 in forum C Programming
    Replies: 6
    Last Post: 03-18-2008, 01:56 PM
  2. Clearing the console
    By beanroaster in forum C++ Programming
    Replies: 53
    Last Post: 09-14-2005, 07:46 PM
  3. running time for memchr()
    By axon in forum C++ Programming
    Replies: 5
    Last Post: 12-04-2003, 11:50 AM
  4. calculating user time and time elapsed
    By Neildadon in forum C++ Programming
    Replies: 0
    Last Post: 02-10-2003, 06:00 PM