• Advertisement

Archived

This topic is now archived and is closed to further replies.

Making game run faster...

This topic is 5935 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I saw taliesin73 post something about profiling my game and seeing where it spends most of its time, and I was just wondering, how do I do that?

Share this post


Link to post
Share on other sites
Advertisement
I am not sure, but I think that is only a feature of VC++ PRO edition, not the standard edition. You could probably use the PerformanceTimer though to measure the elapsed time of each routine, kinda like


// Do (and time) routines
time1=QueryPerformanceTimer(...
Routine1();
time2=QueryPerformanceTimer(...
Routine2();
time3=QueryPerformanceTimer(...
Routine3();
time4=QueryPerformanceTimer(...

// Calculate ratios
TotalTime=time4-time1;
Routine1Time=100*(time2-time1)/TotalTime;
Routine2Time=100*(time3-time2)/TotalTime;
Routine3Time=100*(time4-time3)/TotalTime;


This SHOULD return the % time spent on each routine, but I dunno, I just thought of it now, havent tried it.

Share this post


Link to post
Share on other sites
In VC you can use the built in profiler. Enable profiling under Project->Settings->Linking, then Build Profiling. While it works for other programs, this crashes in D3D for me though. Anyone know how to fix it?

Share this post


Link to post
Share on other sites

  • Advertisement