OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/base/base.html"> | 8 <link rel="import" href="/tracing/base/base.html"> |
9 | 9 |
10 <script> | 10 <script> |
11 'use strict'; | 11 'use strict'; |
12 | 12 |
13 tr.exportTo('tr.b', function() { | 13 tr.exportTo('tr.b.math', function() { |
14 /** | 14 /** |
15 * An object of this class computes basic statistics online in O(1). | 15 * An object of this class computes basic statistics online in O(1). |
16 * Usage: | 16 * Usage: |
17 * 1. Create an instance. | 17 * 1. Create an instance. |
18 * 2. Add numbers using the |add| method. | 18 * 2. Add numbers using the |add| method. |
19 * 3. Query statistics. | 19 * 3. Query statistics. |
20 * 4. Repeat from step 2. | 20 * 4. Repeat from step 2. |
21 */ | 21 */ |
22 class RunningStatistics { | 22 class RunningStatistics { |
23 constructor() { | 23 constructor() { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 ] = dict; | 171 ] = dict; |
172 return result; | 172 return result; |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 return { | 176 return { |
177 RunningStatistics, | 177 RunningStatistics, |
178 }; | 178 }; |
179 }); | 179 }); |
180 </script> | 180 </script> |
OLD | NEW |