Thread: difftime? i have a ?

  1. #1
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378

    Exclamation difftime? i have a ?

    I was asked this ?. The tool that tells you what % of execution time is being used by each function in your program is:

    my ? is the answer profile or difftime?

    i said profile becuase when i looked up difftime, it said it took the difference between 2 integers but someone told me i was still wrong. Can anyone please explain why its difftime besides the definition i seen in the libro.
    Thanks!
    cj
    Last edited by correlcj; 08-12-2002 at 05:58 PM.

  2. #2
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    djgpp 2.01 or 2.02, i forget which:
    Syntax
    #include <time.h>

    double difftime(time_t t1, time_t t0);

    Description
    This function returns the difference in time, in seconds, from t0 to t1.

    Return Value
    The number of seconds.

    Example
    Code:
    time_t t1, t0;
    double elapsed;
    time(&t0);
    do_something();
    time(&t1);
    elapsed = difftime(t1, t0);
    hello, internet!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Counter (Time)
    By PickleBranston in forum C Programming
    Replies: 16
    Last Post: 02-10-2009, 01:00 PM
  2. memory leaks
    By TehOne in forum C Programming
    Replies: 4
    Last Post: 10-10-2008, 09:33 PM
  3. Calculating execution using difftime
    By Finesse in forum C Programming
    Replies: 1
    Last Post: 11-29-2004, 01:26 PM
  4. difftime issues
    By mmyers1 in forum C++ Programming
    Replies: 1
    Last Post: 04-20-2004, 01:08 PM
  5. Help: using time difftime function
    By fe344 in forum C Programming
    Replies: 5
    Last Post: 11-13-2002, 08:08 PM