467,907 Members | 1,418 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

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
  • viewed: 1616
Share:
4 Replies
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.programmer.win32 is likely to be a good place to ask.

--
Keith Thompson (The_Other_Keith) 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_Keith) 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.org> 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 "independant" : I of course meant
dependant as the first lines on the link make clear
Feb 22 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Tu-Thach | last post: by
4 posts views Thread by Qwert | last post: by
1 post views Thread by shsandeep | last post: by
5 posts views Thread by Beemer Biker | last post: by
15 posts views Thread by student4lifer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.