Created
June 10, 2019 11:34
-
-
Save luizjacomn/cdda1133f89fb2e28799e0c50a4af99d to your computer and use it in GitHub Desktop.
Diferença entre durations em Dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Duration duration = Duration(minutes: 1, seconds: 10); | |
int d1 = duration.inMicroseconds; | |
Duration duration2 = Duration(minutes: 2, seconds: 25); | |
int d2 = duration2.inMicroseconds; | |
print('$duration -> $d1'); | |
print('$duration2 -> $d2'); | |
int diff = d2-d1; | |
Duration duration3 = Duration(microseconds: diff); | |
print('$duration3 -> $diff'); | |
print(duration2 - duration); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment