Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
measure running time on windows XP
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
nikoo  
View profile  
 More options Nov 8, 1:20 am
From: nikoo <shaker.far...@gmail.com>
Date: Sat, 7 Nov 2009 22:20:40 -0800 (PST)
Local: Sun, Nov 8 2009 1:20 am
Subject: measure running time on windows XP
Hi,
How can we measure running time of an algorithm on windows XP using
visual c++ ?

Thanks


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amir hossein Shahriari  
View profile  
 More options Nov 8, 2:36 am
From: Amir hossein Shahriari <amir.hossein.shahri...@gmail.com>
Date: Sun, 8 Nov 2009 11:06:07 +0330
Local: Sun, Nov 8 2009 2:36 am
Subject: Re: [algogeeks] measure running time on windows XP

#include <time.h>

in time.h there's a function named clock() which counts cpu clocks since the
beginning of your program
it also contains a constant named CLOCKS_PER_SEC
so if you divide clock() by CLOCKS_PER_SEC at the end of your code you'll
get the running time
(remember to cast the result to double to get the exact result)

cout << clock() / (double) CLOCKS_PER_SEC << endl;


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google