473,508 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Runtime calculation

Ken
Hello

In microsoft Visual c++
Is it possible to calculate the runtime of a function?
If so where do we go to activate it.

Thank you

ken
Jul 23 '05 #1
4 3700
Ken wrote:
In microsoft Visual c++
Is it possible to calculate the runtime of a function?
If so where do we go to activate it.


Please consider posting to 'microsoft.public.vc.language', which
incidentally is the newsgroup for that compiler. Here we talk
standard C++ as a _language_ only, not products or compilers.

V
Jul 23 '05 #2
Ken wrote:
In microsoft Visual c++
Is it possible to calculate the runtime of a function?
If so where do we go to activate it.

????????????????

Do you mean the time spent in a function when executing it?
Jul 23 '05 #3
Ken wrote:
Hello

In microsoft Visual c++
Is it possible to calculate the runtime of a function?
If so where do we go to activate it.

Thank you

ken


clock() is an ANSI Std function avail in Stds conforming
implementations.

Here's an example:

#include <iostream>
#include <ctime>

int main( )
{
int x = 100;
long i = 600000L;
clock_t start, finish;
double duration;
// Measure how long to do 600000 loops 100 times.
std::cout << "Time to do " << i << " empty loops "
<< x << " times is " << std::endl;
start = std::clock();
while( x--)
{
while( i--)
continue;
i = 600000L;
}
finish = std::clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
std::cout << duration << "seconds" << std::endl;

return 0;
}

Regards,
Larry
Jul 23 '05 #4
Ken

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:Xb*******************@newsread1.mlpsca01.us.t o.verio.net...
Ken wrote:
In microsoft Visual c++
Is it possible to calculate the runtime of a function?
If so where do we go to activate it.


Please consider posting to 'microsoft.public.vc.language', which
incidentally is the newsgroup for that compiler. Here we talk
standard C++ as a _language_ only, not products or compilers.

V


sorry

I posted my message to the otehr newsgroup
Ken
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2471
by: anaxamandr | last post by:
Hi. I have a long loop in ASP that performs a rather lengthy calculation. I would love for my users to be able to stop that calculation, if they so choose, mid way through the process. I attempted...
4
3259
by: Michiel Alsters | last post by:
Hello everybody, I hope anybody can help me. I'll try to give a brief overview of my problem. I have running a program that performs a heavy calculation. To give the user feedback what the...
0
2132
by: Sinisa | last post by:
I have a Windows form which has multiple groups of the same window controls. I wanted to create a control class that has the standard controls in one. something like: public class Sensor :...
1
9379
by: joswell | last post by:
Need a little help please! I am getting runtime error 3001 at oRS.filter = ("RM TYP = '" & cell.Text & "'") Private Sub CommandButton5_Click() Application.ScreenUpdating =...
4
1408
by: Ron | last post by:
I want to create 10 buttons on a form at runtime, the code below is only creating one button labeled 1. Any idea what I am doing wrong? Public Class Form1 Public code(10) As String Public...
5
6223
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
7
54236
by: LucasLondon | last post by:
Hi, I have the code below that I adapted to loop through each column of data (Columns A to GR) to perform an a calculation based on the data in rows 2 to 31 of each column and place the...
3
1839
by: Amit | last post by:
Hello Gurus, I am very new to .net . My application is calculating values on run time ,and after all the calculation , i want to print all calculation as a report to show it to user. please...
4
3215
kcdoell
by: kcdoell | last post by:
Hello: I have the following afterupdate event: Private Sub GWP_AfterUpdate() 'Updates the Total calculation in the control "SumGWP" on the quick reference 'table that is located on the form...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.