Flutter
비동기 함수 일정시간 지연 시키기
beomsuong
2023. 11. 16. 11:02
1
2
3
4
5
6
|
Stopwatch stopwatch = Stopwatch();
stopwatch.start();
await Future.delayed(
Duration(milliseconds: 300 - stopwatch.elapsedMilliseconds), () {
stopwatch.stop();
});
|
cs |
다음과 같이 Stopwatch를 추가하여 최소 지연 시간을 추가 할 수 있다.