OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
8 | 8 |
9 import 'package:analyzer/context/declared_variables.dart'; | 9 import 'package:analyzer/context/declared_variables.dart'; |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 _level++; | 1476 _level++; |
1477 return f(); | 1477 return f(); |
1478 } finally { | 1478 } finally { |
1479 _level--; | 1479 _level--; |
1480 int ms = timer.elapsedMilliseconds; | 1480 int ms = timer.elapsedMilliseconds; |
1481 writeln('--- $msg in $ms ms.'); | 1481 writeln('--- $msg in $ms ms.'); |
1482 } | 1482 } |
1483 } | 1483 } |
1484 | 1484 |
1485 /** | 1485 /** |
1486 * Write a new line into the log | 1486 * Write a new line into the log. |
1487 */ | 1487 */ |
1488 void writeln(String msg) { | 1488 void writeln(String msg) { |
1489 String indent = '\t' * _level; | 1489 if (sink != null) { |
1490 sink.writeln('$indent$msg'); | 1490 String indent = '\t' * _level; |
| 1491 sink.writeln('$indent$msg'); |
| 1492 } |
1491 } | 1493 } |
1492 } | 1494 } |
1493 | 1495 |
1494 /** | 1496 /** |
1495 * The performance measurement section for operations that start and end | 1497 * The performance measurement section for operations that start and end |
1496 * at different place in code, so cannot be run using [PerformanceLog.run]. | 1498 * at different place in code, so cannot be run using [PerformanceLog.run]. |
1497 * | 1499 * |
1498 * The client must call [exit] for every [PerformanceLog.enter]. | 1500 * The client must call [exit] for every [PerformanceLog.enter]. |
1499 */ | 1501 */ |
1500 class PerformanceLogSection { | 1502 class PerformanceLogSection { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 libraryDeclarations.add(new TopLevelDeclarationInSource( | 1681 libraryDeclarations.add(new TopLevelDeclarationInSource( |
1680 file.source, declaration, isExported)); | 1682 file.source, declaration, isExported)); |
1681 } | 1683 } |
1682 } | 1684 } |
1683 } | 1685 } |
1684 | 1686 |
1685 // We're not done yet. | 1687 // We're not done yet. |
1686 return false; | 1688 return false; |
1687 } | 1689 } |
1688 } | 1690 } |
OLD | NEW |