Patch level : 10.0 patch ???
Files correlati : agalib Ricompilazione Demo : [ ] Commento : Modifiche sul profiling in debug sotto la guida di Guy git-svn-id: svn://10.65.10.50/branches/R_10_00@21479 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c7f052ec5a
commit
6a0c18b1d4
@ -20,13 +20,6 @@ TPerformance_profiler::TPerformance_profiler(const char* desc, bool trc)
|
|||||||
_depth++;
|
_depth++;
|
||||||
_start = clock();
|
_start = clock();
|
||||||
|
|
||||||
if (!_trc)
|
|
||||||
{
|
|
||||||
TString80 msg;
|
|
||||||
msg << "Profiling " << desc << "...";
|
|
||||||
statbar_set_title(TASK_WIN, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
const clock_t clk = clock();
|
const clock_t clk = clock();
|
||||||
@ -44,6 +37,8 @@ void TPerformance_profiler::show() const
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
const double s = double(clock() - _start) / CLOCKS_PER_SEC;
|
const double s = double(clock() - _start) / CLOCKS_PER_SEC;
|
||||||
|
|
||||||
|
if (s > 0.1 && (_trc || _depth <= 1)) //visualizzo solo tempi significativi
|
||||||
|
{
|
||||||
int hour = 0, min = 0;
|
int hour = 0, min = 0;
|
||||||
int sec = int(s);
|
int sec = int(s);
|
||||||
const int cent = int((s - sec)*100);
|
const int cent = int((s - sec)*100);
|
||||||
@ -64,14 +59,7 @@ void TPerformance_profiler::show() const
|
|||||||
|
|
||||||
if (_trc)
|
if (_trc)
|
||||||
__trace(msg);
|
__trace(msg);
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_depth <= 1)
|
|
||||||
{
|
|
||||||
statbar_set_title(TASK_WIN, msg);
|
statbar_set_title(TASK_WIN, msg);
|
||||||
if (s > 0)
|
|
||||||
xvt_sys_sleep(500);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user