Open
Conversation
kongwoojin
reviewed
Jul 7, 2025
Contributor
kongwoojin
left a comment
There was a problem hiding this comment.
고생하셨습니다.
질문 주신 부분은 상황에 따라 달라질 것 같네요
일단 현재 코인에서는 Thread를 사용한 방법을 주로 사용합니다.
다만, 이번 과제는 Coroutine을 이용해서 타이머를 구현하는 것이기 때문에 구현해주신 방법이 가장 정석적인 방법입니다.
저 같은 경우 비기너 시절에 한번의 루프에서 발생한 오차를 다름 루프에서 보정하는 방식으로 코드를 작성했었는데, 제출하신 과제가 더 좋은 방법으로 보이네요
| } | ||
| } No newline at end of file | ||
|
|
||
| private fun formatTime(ms: Long): String { |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
김영수 11주차 과제 제출입니다
delay 단독 사용할 경우에 실제 시간과 다르게 스톱워치에 지연이 생길 수 있다고 하신걸 System.currentTimeMillis()을 이용해서 현재 시간과 시작 시간의 차이를 나타내어 봤습니다.
이 방법 외에도 handler나 기본으로 제공하는 timer 기능이 있는 것 같은데, 혹시 어느 방법이 가장 정석적인 방법인지 궁금합니다.