contrib & lib: fix other clients of clock
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 22 May 2016 13:52:48 +0000 (09:52 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sun, 22 May 2016 14:37:15 +0000 (10:37 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/friendz/src/friendz.nit
lib/popcorn/README.md
lib/popcorn/examples/middlewares/example_advanced_logger.nit
lib/popcorn/pop_middlewares.nit

index c0554fe..762eb1d 100644 (file)
@@ -1609,22 +1609,10 @@ redef class App
                game.save
        end
 
-       # Maximum wanted frame per second
-       var max_fps = 30
-
-       # clock used to track FPS
-       private var clock = new Clock
-
        redef fun frame_core(display)
        do
                game.step
                game.draw(display)
-               var dt = clock.lapse
-               var target_dt = 1000000000 / max_fps
-               if dt.sec == 0 and dt.nanosec < target_dt then
-                       var sleep_t = target_dt - dt.nanosec
-                       sys.nanosleep(0, sleep_t)
-               end
        end
 
        redef fun input(input_event)
index 08f7c9a..4712faf 100644 (file)
@@ -505,7 +505,7 @@ class LogHandler
        redef fun all(req, res) do
                var timer = req.timer
                if timer != null then
-                       print "{req.method} {req.uri} {res.color_status} ({timer.total})"
+                       print "{req.method} {req.uri} {res.color_status} ({timer.total}s)"
                else
                        print "{req.method} {req.uri} {res.color_status}"
                end
index b97d10c..7f8e3b1 100644 (file)
@@ -34,7 +34,7 @@ class LogHandler
        redef fun all(req, res) do
                var timer = req.timer
                if timer != null then
-                       print "{req.method} {req.uri} {res.color_status} ({timer.total})"
+                       print "{req.method} {req.uri} {res.color_status} ({timer.total}s)"
                else
                        print "{req.method} {req.uri} {res.color_status}"
                end
index 38e4bd9..518d9dc 100644 (file)
@@ -48,7 +48,7 @@ class ConsoleLog
        redef fun all(req, res) do
                var clock = req.clock
                if clock != null then
-                       print "{req.method} {req.uri} {status(res)} ({clock.total})"
+                       print "{req.method} {req.uri} {status(res)} ({clock.total}s)"
                else
                        print "{req.method} {req.uri} {status(res)}"
                end