Timing my code.
How would i do this?
i know i could use GetTickCount(), but it will just tell me how much time used, not how much time my process actually got during the time it ran.
I''m looking for something like the time thingie that i use on unix, it tells it to me nicely
Jonas Meyer Rasmussenmeyer@diku.dk
Try this function:
DWORD timeGetTime(VOID);
it requires winmm.h and winmm.lib
Basically it returns the amount of time that windows has been up and running...
so just do this:
long BeginTime = TimeGetTime();
long EndTime = 0;
long DeltaTime = 0;
// code and other crap
EndTime = TimeGetTime();
DeltaTime = EndTime - BeginTime;
Regards,
Nekosion
DWORD timeGetTime(VOID);
it requires winmm.h and winmm.lib
Basically it returns the amount of time that windows has been up and running...
so just do this:
long BeginTime = TimeGetTime();
long EndTime = 0;
long DeltaTime = 0;
// code and other crap
EndTime = TimeGetTime();
DeltaTime = EndTime - BeginTime;
Regards,
Nekosion
Regards,Nekosion
oh yeah... it gives millisecond accuracy.
There are more precise functions you can use, but I haven''t had to use them yet.
There are more precise functions you can use, but I haven''t had to use them yet.
Regards,Nekosion
I''m a fan of the HPT functions, such as QueryHighPerformanceTimer.
i''d do the same thing, but i''d call:
if ur using MSVC
heh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have no name that you may call me. I am merely Succinct.
~Succinct Demos Online~
-(Drop me a line here n''at)-
Remember, you can''t like DOS better than win32 just cuz it''s made by m$. M$-DOS is, too.
i''d do the same thing, but i''d call:
|
if ur using MSVC
heh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have no name that you may call me. I am merely Succinct.
~Succinct Demos Online~
-(Drop me a line here n''at)-
Remember, you can''t like DOS better than win32 just cuz it''s made by m$. M$-DOS is, too.
-- Succinct(Don't listen to me)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement