Thread: Calculate Execution Time?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2011
    Location
    India
    Posts
    53

    Calculate Execution Time?

    How to calculate Execution time in milliseconds?
    if i use time() function i can get the result only in seconds .
    What about clock function ? How to print the difference using clock_t variable?

    ts=clock();
    quicksort(x,0,size-1);
    printf("Time elapsed: %f\n", ((double)clock() - ts) / CLOCKS_PER_SEC);

    its only resulting in Seconds .
    Last edited by infantheartlyje; 10-14-2011 at 12:57 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to calculate system time
    By aznbottle in forum C Programming
    Replies: 1
    Last Post: 12-09-2010, 12:30 AM
  2. Calculate time
    By Goo in forum C++ Programming
    Replies: 2
    Last Post: 05-16-2009, 05:24 PM
  3. execution time
    By shuo in forum C++ Programming
    Replies: 3
    Last Post: 10-17-2007, 02:58 AM
  4. Calculate time left...
    By IndioDoido in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 05:33 PM
  5. calculate elapsed-time
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 11-26-2001, 07:42 AM

Tags for this Thread