mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
[flutter_tool] Track APK sha calculation time (#33923)
This commit is contained in:
parent
b3382b9907
commit
5180201fe1
|
@ -61,7 +61,14 @@ String hex(List<int> bytes) {
|
|||
}
|
||||
|
||||
String calculateSha(File file) {
|
||||
return hex(sha1.convert(file.readAsBytesSync()).bytes);
|
||||
final Stopwatch stopwatch = Stopwatch()..start();
|
||||
final List<int> bytes = file.readAsBytesSync();
|
||||
printTrace('calculateSha: reading file took ${stopwatch.elapsedMicroseconds}us');
|
||||
stopwatch.reset();
|
||||
final String sha = hex(sha1.convert(bytes).bytes);
|
||||
stopwatch.stop();
|
||||
printTrace('calculateSha: computing sha took ${stopwatch.elapsedMicroseconds}us');
|
||||
return sha;
|
||||
}
|
||||
|
||||
/// Convert `foo_bar` to `fooBar`.
|
||||
|
|
Loading…
Reference in a new issue