MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / computeFPS

Function computeFPS

cpp/0_Introduction/simpleTexture3D/simpleTexture3D.cpp:112–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110void loadVolumeData(char *exec_path);
111
112void computeFPS()
113{
114 frameCount++;
115 fpsCount++;
116
117 if (fpsCount == fpsLimit) {
118 char fps[256];
119 float ifps = 1.f / (sdkGetAverageTimerValue(&timer) / 1000.f);
120 sprintf(fps, "%s: %3.1f fps", sSDKsample, ifps);
121
122 glutSetWindowTitle(fps);
123 fpsCount = 0;
124
125 fpsLimit = ftoi(MAX(1.0f, ifps));
126 sdkResetTimer(&timer);
127 }
128}
129
130// render image using CUDA
131void render()

Callers 1

displayFunction · 0.70

Calls 3

sdkGetAverageTimerValueFunction · 0.85
sdkResetTimerFunction · 0.85
ftoiFunction · 0.50

Tested by

no test coverage detected