Outputting Counter Data using PVRScope#
To output counter data using PVRScope, perform the following steps in a loop from 0 to numCounters
:
Check if the counter has been updated and only perform steps 2 through 5 if it has.
if(i < counterReading.nValueCnt) {
Check if the counter is given as a percentage.
bool isPercentage = counterDefinitions[i].bPercentage;
Retrieve the name of the counter.
std::string CounterName = counterDefinitions[i].pszName;
Retrieve the value of the counter.
float counterValue = counterReading.pfValueBuf[i];
Output the value of the counter, such as with
printf
.
if(isPercentage) {
printf("%s : %f%%\n", counterName, counterValue);
} else {
printf("%s : %f\n", counterName, counterValue);
}