Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add total execution time to the flutter upgrade command #171475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matanlurey
Copy link
Contributor

Closes #47090.

@matanlurey matanlurey requested a review from bkonyi July 1, 2025 20:25
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 1, 2025
@@ -113,6 +115,8 @@ class UpgradeCommandRunner {
} else {
await runCommandSecondHalf(flutterVersion);
}
final Duration execution = timer.elapsed;
globals.printStatus('Took ${execution.inMinutes} minutes');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will print 'Took 0 minutes' if it takes less than a minute to upgrade. Can we add seconds as well (e.g., 'Completed in 3:15.0')?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add this, consider adding a elapsedAsMinutes helper here:

final NumberFormat kSecondsFormat = NumberFormat('0.0');
final NumberFormat kMillisecondsFormat = NumberFormat.decimalPattern();
String getElapsedAsSeconds(Duration duration) {
final double seconds = duration.inMilliseconds / Duration.millisecondsPerSecond;
return '${kSecondsFormat.format(seconds)}s';
}
String getElapsedAsMilliseconds(Duration duration) {
return '${kMillisecondsFormat.format(duration.inMilliseconds)}ms';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flutter Upgrade - Add total execution time summary
3 participants