diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 222: MainLoop, Android: Display average frame time in addition to FPS for each scene.

Message ID 20120619095310.15926.48978.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org June 19, 2012, 9:53 a.m. UTC
------------------------------------------------------------
revno: 222
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: frame-time
timestamp: Fri 2012-06-15 16:24:32 +0300
message:
  MainLoop,Android: Display average frame time in addition to FPS for each scene.
modified:
  src/android.cpp
  src/main-loop.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/android.cpp'
--- src/android.cpp	2012-05-15 12:28:51 +0000
+++ src/android.cpp	2012-06-15 13:24:32 +0000
@@ -48,8 +48,10 @@ 
 
     virtual void log_scene_result()
     {
-        Log::info("%s FPS: %u", scene_->info_string().c_str(),
-                                scene_->average_fps());
+        Log::info("%s FPS: %u FrameTime: %.3f ms\n",
+                  scene_->info_string().c_str(),
+                  scene_->average_fps(),
+                  1000.0 / scene_->average_fps());
     }
 };
 

=== modified file 'src/main-loop.cpp'
--- src/main-loop.cpp	2012-02-15 17:09:14 +0000
+++ src/main-loop.cpp	2012-06-15 13:24:32 +0000
@@ -134,8 +134,11 @@ 
 void
 MainLoop::log_scene_result()
 {
-    static const std::string format(Log::continuation_prefix + " FPS: %u\n");
-    Log::info(format.c_str(), scene_->average_fps());
+    static const std::string format_fps(Log::continuation_prefix + " FPS: %u");
+    static const std::string format_ms(Log::continuation_prefix + " FrameTime: %.3f ms\n");
+
+    Log::info(format_fps.c_str(), scene_->average_fps());
+    Log::info(format_ms.c_str(), 1000.0 / scene_->average_fps());
 }
 
 void