Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
| 3 | Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 4 | Use of this source code is governed by a BSD-style license that can be |
| 5 | found in the LICENSE file. |
| 6 | --> |
| 7 | <link rel="import" href="/base/iteration_helpers.html"> |
| 8 | <link rel="import" href="/base/rect.html"> |
| 9 | <script> |
| 10 | 'use strict'; |
| 11 | |
| 12 | tv.exportTo('tv.b', function() { |
| 13 | /** |
| 14 | * Float wrapper, representing a time duration, capable of pretty-printing. |
| 15 | */ |
| 16 | function TimeDuration(duration) { |
| 17 | this.duration = duration; |
| 18 | }; |
| 19 | |
| 20 | TimeDuration.prototype = { |
| 21 | toString: function() { |
| 22 | return this.duration.toFixed(3) + ' ms'; |
| 23 | } |
| 24 | }; |
| 25 | |
| 26 | function TimeStamp(timestamp) { |
| 27 | this.timestamp = timestamp; |
| 28 | }; |
| 29 | |
| 30 | TimeStamp.prototype = { |
| 31 | toString: function() { |
| 32 | return this.timestamp.toFixed(4) + ' ms'; |
| 33 | } |
| 34 | }; |
| 35 | |
| 36 | return { |
| 37 | TimeStamp: TimeStamp, |
| 38 | TimeDuration: TimeDuration |
| 39 | }; |
| 40 | }); |
| 41 | </script> |