{"id":1791,"date":"2020-03-25T00:05:00","date_gmt":"2020-03-24T15:05:00","guid":{"rendered":"https:\/\/www.itchefblog.com\/?p=1791"},"modified":"2021-04-22T02:42:48","modified_gmt":"2021-04-21T17:42:48","slug":"timer-%ea%b8%b0%eb%8a%a5-%ec%82%ac%ec%9a%a9%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.itchefblog.com\/?p=1791","title":{"rendered":"Timer \uae30\ub2a5 \uc0ac\uc6a9\ud558\uae30"},"content":{"rendered":"<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/\ucf54\ud2c0\ub9b0\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc77c\uc815 \uc2dc\uac04\uc744 \uc8fc\uae30\ub85c \ubc18\ubcf5\ud558\ub294 \ucf54\ub4dc\ub97c \uc0ac\uc6a9 \uac00\ub2a5\ud558\ub2e4.\ntimer(period = 1000){\n\t\/\/1\ucd08\ub9c8\ub2e4 \uc218\ud589\ud560 \ub3d9\uc791\n}\n\n\/\/\uc548\ub4dc\ub85c\uc774\ub4dc\uc5d0\uc11c\ub294 UI\ub97c \uc870\uc791\ud558\ub294 \uba54\uc778 \uc2a4\ub808\ub4dc\uc640 \uc624\ub798 \uac78\ub9ac\ub294 \uc791\uc5c5\uc744 \ubcf4\uc774\uc9c0 \uc54a\ub294 \uacf3\uc5d0\uc11c \ucc98\ub9ac\ud558\ub294\n\/\/\uc6cc\ucee4 \uc2a4\ub808\ub4dc\uac00 \uc874\uc7ac\ud55c\ub2e4. \uc704 \ucf54\ub4dc\ub294 \uc6cc\ucee4\uc2a4\ub808\ub4dc\uc5d0\uc11c \ub3d9\uc791\ud558\ub294 \ucf54\ub4dc\uc774\ub2e4.\n\/\/\uc6cc\ucee4 \uc2a4\ub808\ub4dc\uc5d0\uc11c\ub294 UI\ub97c \uc870\uc791\ud560 \uc218 \uc5c6\ub2e4. \uc774\ub54c\ub294 runOnUiThresd()\uc5d0\uc11c \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4.\ntimer(period = 1000){\n\t\/\/\uc624\ub798 \uac78\ub9ac\ub294 \uc791\uc5c5\n\trunOnUiThread{\n\t\t\/\/UI \uc870\uc791\n\t}\n}\n\n\/\/Timer\uc744 \uc870\uc791\ud558\ub824\uba74 \ubcc0\uc218\uc5d0 Timer \uac1d\uccb4\ub97c \ud560\ub2f9\ud574\uc57c\ud55c\ub2e4.\nvar timerTask: Timer? = null\ntimerTask = timer(perion = 1000){\n\t\/\/\uc218\ud589\ud560 \ub0b4\uc6a9\n}\n\n\/\/timer\uc744 \uc885\ub8cc\ud560 \uacbd\uc6b0\ntimerTask?.cancel()\n<\/pre>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[349,7,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1791"}],"collection":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1791"}],"version-history":[{"count":1,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1791\/revisions"}],"predecessor-version":[{"id":1792,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1791\/revisions\/1792"}],"wp:attachment":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}