Menu

#12 CUDT::sample when clear = false

open
nobody
None
5
2013-01-28
2008-08-13
Alex
No

void CUDT::sample(CPerfMon* perf, bool clear) in core.cpp

Since the documentation for the perfmon function is missing (doc/perfmon.htm) I can't say for certain what the behavior of sample(CPerfMon*, bool) is supposed to be when clear is false, however, it appears that the local counters are not to be reset in this case.

The local counters are indeed not reset when clear is false, however, these counters are added to the total counters. The next time sample(CPerfMon*, bool) is called, the local values will again be added to the total counters, resulting in double counting.

FIX:
If clear is true, add the local counters to the total counters. Assign all counters to the CPerfMon* perf parameter. Clear the local counters.

If clear is false, assign all counters to the CPerfMon* perf parameter. Add the local counters to the CPerfMon* perf total counters.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    How kind in the use of udt.dll delphi?

     
  • Yunhong Gu

    Yunhong Gu - 2008-09-09

    Hello, the document is in ./doc/trace.html. When "clear" is true, all counters will be reset to 0 each time perfmon is called, otherwise the counters will continue to increase.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.