-
Notifications
You must be signed in to change notification settings - Fork 0
Assignment 10 #7
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
base: assignment04
Are you sure you want to change the base?
Conversation
skdud0629
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨어요!
| } | ||
| else { | ||
| Toast.makeText(this, "오류", Toast.LENGTH_SHORT).show() | ||
| if (!running) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if else 문으로 안 하고 if문을 두 번 쓴 이유가 있을까요?
|
|
||
| private fun startTimer(){ | ||
| stime = System.currentTimeMillis() | ||
| timer = CoroutineScope(Dispatchers.Main).launch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycleScope을 사용하는 것이 더 안전합니다.
| stime = System.currentTimeMillis() | ||
| timer = CoroutineScope(Dispatchers.Main).launch { | ||
| while(true){ | ||
| delay(5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
딜레이를 하는 이유가 있을까용??
delay를 사용하여 10ms마다 숫자를 증가하고 업데이트 하려하였는데,
왠지 모르게 기존의 스톱워치보다 느리게 작동하여 System.currentTimeMillis()을 사용하여 정확한 스톱워치를 만들었음