diff --git a/lib/src/kociemba_solver.dart b/lib/src/kociemba_solver.dart index bf8fe4c..b1f4616 100644 --- a/lib/src/kociemba_solver.dart +++ b/lib/src/kociemba_solver.dart @@ -165,9 +165,8 @@ class KociembaSolver extends Solver { (search.ax[depthPhaseOne - 1] != search.ax[depthPhaseOne] && search.ax[depthPhaseOne - 1] != search.ax[depthPhaseOne] + 3)) { - final elapsedTime = sw.elapsedMilliseconds; final moves = _moves(search, s); - return Solution(moves: moves, elapsedTime: elapsedTime); + return Solution(moves: moves, elapsedTime: sw.elapsed); } } } diff --git a/lib/src/solution.dart b/lib/src/solution.dart index 6a9c386..7f70c6e 100644 --- a/lib/src/solution.dart +++ b/lib/src/solution.dart @@ -8,12 +8,12 @@ class Solution extends Equatable { final List moves; /// Elapsed time to find the [Solution]. - final int elapsedTime; + final Duration elapsedTime; /// Creates a [Solution] instance. const Solution({ this.moves = const [], - this.elapsedTime = 0, + this.elapsedTime = const Duration(), }); /// Empty solution. diff --git a/lib/src/solver.dart b/lib/src/solver.dart index 0920482..d5aed86 100644 --- a/lib/src/solver.dart +++ b/lib/src/solver.dart @@ -45,7 +45,7 @@ abstract class Solver { if (maxDepth > 0 && s != null && s.isNotEmpty) { if (!solutions.contains(s)) { solutions.add(s); - yield s; + yield Solution(moves: s.moves, elapsedTime: sw.elapsed); maxDepth = s.length - 1; } else { maxDepth--;