[gnome-sudoku] Fix clock causing excessive CPU usage



commit cafbadb6d74991a667d1f814a522d467e0df0356
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Oct 4 15:50:38 2014 -0500

    Fix clock causing excessive CPU usage
    
    Separate from the "Sudoku generator causes excessive CPU usage" issue.

 lib/sudoku-game.vala |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/lib/sudoku-game.vala b/lib/sudoku-game.vala
index 7af3bd6..2241223 100644
--- a/lib/sudoku-game.vala
+++ b/lib/sudoku-game.vala
@@ -156,14 +156,8 @@ public class SudokuGame : Object
 
     private bool timeout_cb ()
     {
-        /* Notify on the next tick */
-        var elapsed = get_total_time_played ();
-        var next = (int) (elapsed + 1.0);
-        var wait = next - elapsed;
-        clock_timeout = Timeout.add_seconds ((int) (wait), timeout_cb);
-
+        clock_timeout = Timeout.add_seconds (1, timeout_cb);
         tick ();
-
         return false;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]