Created
October 20, 2021 20:47
-
-
Save boriscy/0064d23c89268748053eed5fffc793b8 to your computer and use it in GitHub Desktop.
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
import 'dart:async'; | |
void main() { | |
var duration = Duration(milliseconds: 500); | |
var t = Timer.periodic(duration, (Timer t) { | |
print('Update ${t}'); | |
}); | |
print(t.isActive); | |
var d2 = Duration(seconds: 2); | |
Timer(d2, () { | |
t.cancel(); | |
print(t.isActive); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment