hi,
i am a newby, i am new to c++. i have a very basic question. how do i sandwich a function to see how many millisecond it take to runs?
thanks
how to get millisecond and print it out?
-
- In need of some credit
- Posts: 8
- Joined: Tue Jun 28, 2011 2:20 am
-
- Moderator
- Posts: 19164
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
-
- In need of some credit
- Posts: 8
- Joined: Tue Jun 28, 2011 2:20 am
Re: how to get millisecond and print it out?
thanks doublemax. it will probably takes me couple of days to digest it. i really appreciate it.
-
- In need of some credit
- Posts: 8
- Joined: Tue Jun 28, 2011 2:20 am
Re: how to get millisecond and print it out?
hi doublemax:
i looked at the stopwatch.h and found that Time() is declared but not defined. is that the header file of mine is inadequate? when i called the Time(), the compiler gave me an undefined error. i thought that the include statement in my program <wx/stopwatch.h> is incorrect but it did not generate any error.
please help.
thanks.
i looked at the stopwatch.h and found that Time() is declared but not defined. is that the header file of mine is inadequate? when i called the Time(), the compiler gave me an undefined error. i thought that the include statement in my program <wx/stopwatch.h> is incorrect but it did not generate any error.
please help.
thanks.
-
- Moderator
- Posts: 19164
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
Re: how to get millisecond and print it out?
Do you get a compiler or linker error?
Also, which platform/IDE/compiler are you using?
If you're totally new to c++ and wxWidgets, you should start by getting the wxWidgets "minimal" sample to compile. That makes sure you have all the include directories and libraries correct.
Also, which platform/IDE/compiler are you using?
If you're totally new to c++ and wxWidgets, you should start by getting the wxWidgets "minimal" sample to compile. That makes sure you have all the include directories and libraries correct.
Use the source, Luke!
-
- In need of some credit
- Posts: 8
- Joined: Tue Jun 28, 2011 2:20 am
Re: how to get millisecond and print it out?
hi,
i got linker errors and i used wxDevc++. i don't know what you mean by minimal sample?
thanks for reply.
i got linker errors and i used wxDevc++. i don't know what you mean by minimal sample?
thanks for reply.
-
- In need of some credit
- Posts: 8
- Joined: Tue Jun 28, 2011 2:20 am
Re: how to get millisecond and print it out?
hi,
i did not use wxwidget, i wrote a program basically a procedural oriented C type program. it run just fine. i used time.h's time() to measure a function. but it only returned time in seconds. when it run, i usually got o second. that is why i want to benchmark it with milliseconds.
thanks.
i did not use wxwidget, i wrote a program basically a procedural oriented C type program. it run just fine. i used time.h's time() to measure a function. but it only returned time in seconds. when it run, i usually got o second. that is why i want to benchmark it with milliseconds.
thanks.
-
- Moderator
- Posts: 19164
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
Re: how to get millisecond and print it out?
AFAIK there is no easy standard way to get millisecond accuracy.
Maybe this helps:
http://stackoverflow.com/questions/3613 ... ing-ansi-c
Maybe this helps:
http://stackoverflow.com/questions/3613 ... ing-ansi-c
Use the source, Luke!
-
- In need of some credit
- Posts: 8
- Joined: Tue Jun 28, 2011 2:20 am
Re: how to get millisecond and print it out?
thank you very much. it helps a lot.
bye.
bye.
-
- In need of some credit
- Posts: 7
- Joined: Thu Jan 02, 2014 3:55 pm
Re: how to get millisecond and print it out?
I was just looking for this and I've found this thread.
www.ipillows.net
When I click the link it says Documentation Not Found 21 day fix video
Thanks Best Phone Grip
Days to Fitness Ted Reviews
Sarah Tycoon Addon
www.ipillows.net
When I click the link it says Documentation Not Found 21 day fix video
Thanks Best Phone Grip
Days to Fitness Ted Reviews
Sarah Tycoon Addon
Last edited by Sarah Keys on Wed Jul 15, 2015 4:17 pm, edited 3 times in total.
-
- Part Of The Furniture
- Posts: 4204
- Joined: Sun Jan 03, 2010 5:45 pm
Re: how to get millisecond and print it out?
You were just one click away from the page, all you needed was to select the version. Anyway, here it goes
current version: http://docs.wxwidgets.org/trunk/classwx_stop_watch.html
old version 2.8.12: http://docs.wxwidgets.org/2.8.12/wx_wxstopwatch.html
current version: http://docs.wxwidgets.org/trunk/classwx_stop_watch.html
old version 2.8.12: http://docs.wxwidgets.org/2.8.12/wx_wxstopwatch.html
-
- In need of some credit
- Posts: 7
- Joined: Thu Jan 02, 2014 3:55 pm
Re: how to get millisecond and print it out?
Ah you are right . Thanks for the help
Sarah
Sarah