473,669 Members | 2,514 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 3707
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.publ ic.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.********@com Acast.net> wrote in message
news:Xb******** ***********@new sread1.mlpsca01 .us.to.verio.ne t...
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.publ ic.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
2480
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 to use a parent window that allows the user to launch the calculation in a seperate window, so that they could still click "stop" to write a value to a database or set a session level variable that the calculation would check to see if it should...
4
3268
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 program is doing I show a window which contains a progress bar and a label. At some point during the execution the state of the calculation is changed, so I want to let the user know this. I have placed the creation of the form in a seperate thread...
0
2146
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 : System.Windows.Forms.Control { private System.Windows.Forms.TextBox Calculation;
1
9397
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 = False Application.Calculation = xlCalculationManual Dim oRS As New ADODB.Recordset Dim oCN As New ADODB.Connection With oCN
4
1410
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 buttons(10) As Button Const buttonwh As Integer = 30 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
5
6246
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 user modifies any of the x, y and z values.
7
54247
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 calculated statistic in row 35 for each column of data. The problem is the code runs fine for the first six columns of data (i.e row 35 for columns A:F get populated with a correctly calculated statistic but code stops running at column G, and generates a...
3
1843
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 advise how to achieve this . this is very urgent .
4
3222
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 With Me! DoCmd.Requery
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8810
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8590
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4208
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2798
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 we have to send another system
2
2035
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1790
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.