core/stream: change read_byte return type to Int
[nit.git] / lib / performance_analysis.nit
index 4763061..61f0186 100644 (file)
@@ -60,9 +60,14 @@ class PerfMap
                return ts
        end
 
+       # Number of digits to the right of the decimal points in reports created by `to_s`
+       #
+       # Defaults to 4.
+       var precision = 4 is writable
+
        redef fun to_s
        do
-               var prec = 3
+               var prec = precision
 
                var table = new Map[String, Array[String]]
                for event, stats in self do
@@ -122,11 +127,8 @@ class PerfEntry
        # Total execution time of this event
        var sum = 0.0
 
-       # Register a new event execution time with a `Timespec`
-       fun add(lapse: Timespec) do add_float lapse.to_f
-
-       # Register a new event execution time in seconds using a `Float`
-       fun add_float(time: Float)
+       # Register a new event execution time in seconds
+       fun add(time: Float)
        do
                if time.to_f < min.to_f or count == 0 then min = time
                if time.to_f > max.to_f then max = time