473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i calculate a execute Time of routine Or function?

Hi all,
I want to calculate a time of any routine in micro second.I know there
is a function utime.h in the programming linux.But I'm using a OS
Windows. If somebody know the soluction, let me know, please. Thanks!!

Feb 21 '06 #1
4 1863
On 2006-02-21, Romulo Carneiro <ro***********@ gmail.com> wrote:
Hi all,
I want to calculate a time of any routine in micro second.I know there
is a function utime.h in the programming linux.But I'm using a OS
Windows. If somebody know the soluction, let me know, please. Thanks!!


Two seconds with google :
http://www.unb.ca/metrics/software/HRtime.html

HW & OS Platform independant.

--
Remove evomer to reply
Feb 21 '06 #2
"Romulo Carneiro" <ro***********@ gmail.com> writes:
I want to calculate a time of any routine in micro second.I know there
is a function utime.h in the programming linux.But I'm using a OS
Windows. If somebody know the soluction, let me know, please. Thanks!!


Then ask in a Windows programming newsgroup (assuming you can't find
the answer in your system's documentation).
comp.os.ms-windows.program mer.win32 is likely to be a good place to ask.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 21 '06 #3
"Richard G. Riley" <rg***********@ gmail.com> writes:
On 2006-02-21, Romulo Carneiro <ro***********@ gmail.com> wrote:
Hi all,
I want to calculate a time of any routine in micro second.I know there
is a function utime.h in the programming linux.But I'm using a OS
Windows. If somebody know the soluction, let me know, please. Thanks!!


Two seconds with google :
http://www.unb.ca/metrics/software/HRtime.html

HW & OS Platform independant.


No, the code at that URL is Windows-specific (see the "#include <windows.h>"
in the source code).

I don't believe it's possible to implement a high-resolution timer
that's independent of the hardware and operating system. It may be
possible to implement one that's fairly widely portable, using a nest
of #ifdefs, but some systems may not even provide a way to get a time
to microsecond resolution.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 21 '06 #4
On 2006-02-21, Keith Thompson <ks***@mib.or g> wrote:
"Richard G. Riley" <rg***********@ gmail.com> writes:
On 2006-02-21, Romulo Carneiro <ro***********@ gmail.com> wrote:
Hi all,
I want to calculate a time of any routine in micro second.I know there
is a function utime.h in the programming linux.But I'm using a OS
Windows. If somebody know the soluction, let me know, please. Thanks!!


Two seconds with google :
http://www.unb.ca/metrics/software/HRtime.html

HW & OS Platform independant.


No, the code at that URL is Windows-specific (see the "#include <windows.h>"
in the source code).

Grrr. I have no idea why I wrote "independan t" : I of course meant
dependant as the first lines on the link make clear
Feb 22 '06 #5

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

Similar topics

11
7781
by: David | last post by:
I am learning plsql. I would like to run a stored procedure to calculate my bank account value by predicted 10% annual growth rate. Below is my plsql that is having problems. Your help is highly appreciated. Thanks declare money number := 50000.00; year number := 1;
1
2644
by: FlyPiger | last post by:
I has installed db2 and IBM CM on AIX 5.2.0 That is a error When I execute "ICMNLSUF" ,error is "SQL0444N" "ICMNLSUF" is a costom function of CM, LIBPATH=/usr/lpp/icm/lib:/usr/lpp/icm/inso:/usr/lib:/lib:/mqha/db2ha/db2inst2/sqllib/lib HELP ME. Thanks.
0
6592
by: Tu-Thach | last post by:
TimeSpan span = aEnd.Subtract(aStart); System.Console.WriteLine(span.TotalMilliseconds); Tu-Thach >-----Original Message----- >I want to calculate the time it takes to execute a function is there a >datediff function? >
7
2613
by: hazz | last post by:
What happens if I set the timer interval for a period that is less than the time it will take to process the loop below? Right now my application is returning just a few items in an arraylist to process but the process should scale to 100 or even 1000 loops. If the functions contained within the loop, some of which go out to web services, take an indeterminate amount of time, how do I design my windows service so that if the code takes...
4
6224
by: Qwert | last post by:
Hello, I do: Debug.WriteLine("A: " & DateTime.Now.Ticks.ToString) REM Calculate a bunch of stuff. Some loops and math functions. Debug.WriteLine("B: " & DateTime.Now.Ticks.ToString) but both A and B have the exact the same value. Is this method incorrect? When I make the function wait for 1 millisecond, A en B differ. Is there
1
5951
by: shsandeep | last post by:
I 'recreated' a stored procedure. Earlier, i had given privileges to a particular group but now (after rebuilding) when I try to grant execute privilege for the SP to the same user group, it gives me the below message. Any clues on this?? SQL0458N In a reference to routine "SITSCHM.SP_ERND_PREM" by signature, a matching routine could not be found. SQLSTATE=42883
2
7924
by: cylin | last post by:
Hi, I am currently doing a project regarding image processing. I had facing problem writing C++ code to calculate time taken to execute a function. Can somebody help me on this. thanks. #include "picture.h" #include <iostream> using namespace std; int main()
5
13659
by: Beemer Biker | last post by:
I cant seem to get that date into any DateTime to make my calculation directly by subtracting "01-01-0000" from "now". After reading this: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11469&objectType=File I kluged up this routine that works: // convert date time into that funny matlab serial date time that starts at jan 1, 0000 private string DT2Matlab(DateTime thisDT)
15
6420
by: student4lifer | last post by:
Hello, I have 2 time fields dynamically generated in format "m/d/y H:m". Could someone show me a good function to calculate the time interval difference in minutes? I played with strtotime() but but that only gave me difference in hours and only if the times were on the same day (after wrapping with date() function). TIA
0
8427
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
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
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
8525
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
7356
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
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
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.