MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / endFrame

Method endFrame

common/Profiler.cpp:69–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68
69void Profiler::endFrame(long pixels, long bytes, double incFrames)
70{
71 if(!profile) return;
72 double now = timer.time();
73 if(start != 0.0)
74 {
75 totalTime += now - start;
76 if(pixels) mpixels += (double)pixels / 1000000.;
77 if(bytes) mbytes += (double)bytes / 1000000.;
78 if(incFrames != 0.0) frames += incFrames;
79 }
80 if(lastFrame == 0.0) lastFrame = now;
81 if(totalTime > interval || (now - lastFrame) > interval)
82 {
83 char temps[256]; size_t i = 0;
84 snprintf(&temps[i], 255 - i, "%s ", name); i = strlen(temps);
85 if(mpixels)
86 {
87 snprintf(&temps[i], 255 - i, "- %7.2f Mpixels/sec", mpixels / totalTime);
88 i = strlen(temps);
89 }
90 if(frames)
91 {
92 snprintf(&temps[i], 255 - i, "- %7.2f fps", frames / totalTime);
93 i = strlen(temps);
94 }
95 if(mbytes)
96 {
97 snprintf(&temps[i], 255 - i, "- %7.2f Mbits/sec (%.1f:1)",
98 mbytes * 8.0 / totalTime, mpixels * 3. / mbytes);
99 i = strlen(temps);
100 }
101 vglout.PRINT("%s\n", temps);
102 totalTime = 0.; mpixels = 0.; frames = 0.; mbytes = 0.;
103 lastFrame = now;
104 }
105}

Callers 11

runMethod · 0.80
runMethod · 0.80
compressSendMethod · 0.80
makeAnaglyphMethod · 0.80
makePassiveMethod · 0.80
readPixelsMethod · 0.80
runMethod · 0.80
sendFrameMethod · 0.80
readPixelsMethod · 0.80
runMethod · 0.80
sendFrameMethod · 0.80

Calls 2

timeMethod · 0.80
PRINTMethod · 0.80

Tested by

no test coverage detected