{"id":174,"date":"2018-11-24T11:09:03","date_gmt":"2018-11-24T02:09:03","guid":{"rendered":"https:\/\/dalomo.net\/blog\/?p=174"},"modified":"2018-11-24T11:11:24","modified_gmt":"2018-11-24T02:11:24","slug":"%e3%83%aa%e3%83%90%e3%83%bc%e3%82%b7%e3%81%a7%e6%99%82%e9%96%93%e8%a1%a8%e7%a4%ba%e3%81%97%e3%81%9f%e3%81%84","status":"publish","type":"post","link":"https:\/\/dalomo.net\/blog\/2018\/11\/24\/174\/","title":{"rendered":"\u30ea\u30d0\u30fc\u30b7\u3067\u6642\u9593\u8868\u793a\u3057\u305f\u3044"},"content":{"rendered":"<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/PWwSgrPZ1X8\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>\u30c1\u30a7\u30b9\u30af\u30ed\u30c3\u30af\u7684\u306a\u6642\u9593\u8868\u793a\u3092\u3055\u305b\u305f\u3044\u306a\u30fc\u3063\u3066\u601d\u3063\u3066\u305f\u3093\u3060\u3051\u3069\u3001\u6642\u9593\u8a2d\u5b9a\u3068\u304b\u79d2\u8aad\u307f\u3068\u304b\u5207\u308c\u8ca0\u3051\u3068\u304b\u5b9f\u88c5\u3059\u308b\u306e\u3081\u3093\u3069\u304f\u3055\u305d\u3046\u3002\u306a\u306e\u3067\u7d4c\u904e\u6642\u9593\u3060\u3051\u8868\u793a\u3055\u305b\u3088\u3046\u3068\u601d\u3046\u3002<\/p>\n<h3>Chronometer<\/h3>\n<p>\u4e00\u756a\u7c21\u5358\u306a\u306e\u304c\u3053\u308c\u307f\u305f\u3044\u3002\u30c7\u30b6\u30a4\u30f3\u3068\u304b\u306f\u4eca\u306e\u6240\u3069\u3046\u3067\u3082\u3044\u3044\u306e\u3067\u30b5\u30af\u30c3\u3068\u4f5c\u3063\u3066\u3057\u307e\u304a\u3046\u3002\u2026\u3068\u601d\u3063\u3066\u3044\u305f\u3093\u3060\u3051\u3069\u3001Chronometer\u306fstop\u3057\u3066\u3082\u6642\u9593\u306f\u6d41\u308c\u3066\u3044\u3066\u3001\u518d\u958b\u3057\u305f\u6642\u306b\u6b62\u3081\u3066\u305f\u5206\u306e\u6642\u9593\u3082\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3046\u3068\u306a?\u8a66\u3057\u3066\u306a\u3044\u304b\u3089\u77e5\u3089\u3093\u3051\u3069\u3002\u6700\u521d\u304b\u3089\u6697\u7901\u306b\u4e57\u308a\u4e0a\u3052\u3066\u3057\u307e\u3063\u305f\u305e\u3002\u3069\u3046\u3057\u3088\u3046\u3002<\/p>\n<h3>java.util.Timer<\/h3>\n<p>Java\u306b\u5143\u304b\u3089\u3042\u308bTimer\u3063\u3066\u3044\u3046\u306e\u3092\u4f7f\u3046\u3068\u3044\u3044\u3089\u3057\u3044\u3002\u89e3\u8aac\u30b5\u30a4\u30c8\u3092\u307f\u3066\u307f\u308b\u3068\u3001\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u3084\u3089Handler\u3084\u3089\u4f55\u3084\u3089\u96e3\u3057\u3044\u5358\u8a9e\u304c\u4e26\u3093\u3067\u3044\u308b\u2026\u3002\u30e1\u30a4\u30f3\u3067\u52d5\u3044\u3066\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u306f\u5225\u306b\u7528\u610f\u3059\u308b\u307f\u305f\u3044\u306a\u2026?\u305d\u3093\u3067\u5225\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092\u6e21\u3057\u305f\u308a\u3059\u308b\u306e\u304cHandler\u307f\u305f\u3044\u306a\u2026?\u3084\u3070\u3044\u3001\u5168\u7136\u5206\u304b\u3089\u3093\u305e\u3002\u8abf\u3079\u3066\u307f\u3066\u3082\u3001start, stop\u306b\u95a2\u3059\u308b\u6587\u7ae0\u306f\u51fa\u3066\u304f\u308b\u3051\u3069\u3001\u4e00\u6642\u505c\u6b62\u306b\u95a2\u3059\u308b\u6587\u7ae0\u306f\u51fa\u3066\u3053\u306a\u3044\u305e\u3002\u3069\u3046\u3044\u3046\u3053\u3068\u3060\u3002\u3046\u30fc\u3093\u3046\u30fc\u3093\u3002<\/p>\n<h3 id=\"doc1_id147\" class=\"chapter\">java.util.concurrent.ScheduledExecutorService<\/h3>\n<p>\u4e00\u6642\u505c\u6b62\u3059\u308b\u5834\u5408\u3001\u3053\u3063\u3061\u3092\u4f7f\u3046\u3089\u3057\u3044\u3002\u3082\u3063\u3068\u8a33\u304c\u308f\u304b\u3089\u306a\u3044\u305e\u3002schedule, scheduleAtFixedRate, scheduleWithFixedDelay\u3063\u3066Timer\u89e3\u8aac\u3057\u3066\u308b\u3068\u3053\u3067\u3082\u898b\u305f\u3051\u3069\u540c\u3058\u3053\u3068\u3084\u3063\u3066\u308b\u306e?\u3058\u3083Timer\u3068\u306e\u9055\u3044\u3063\u3066\u306a\u3093\u3058\u3083\u3089\u307b\u3044\u2026\u3002\u3042\u3001\u4e00\u6642\u505c\u6b62\u304b\u3002\u3048\u30fc\u3082\u3046\u306a\u3093\u304b\u308f\u304b\u3093\u306a\u3044\u3088\u30fc\u3002<\/p>\n<h3>\u518d\u5ea6Chronometer<\/h3>\n<p>\u306a\u3093\u304b\u4e00\u6642\u505c\u6b62\u3067\u304d\u308b\u3063\u307d\u3044\u3002\u30bf\u30c3\u30d7\u3055\u308c\u305f\u6642\u306e\u30b7\u30b9\u30c6\u30e0\u6642\u9593\u3092\u53d6\u3063\u3066\u304a\u3044\u3066\u3001\u73fe\u30b7\u30b9\u30c6\u30e0\u6642\u9593\u3068\u306e\u5dee\u3092\u4f7f\u3044\u3001\u57fa\u6e96\u6642\u9593\u3092\u8a2d\u5b9a\u3057\u76f4\u3057\u3066\u30b9\u30bf\u30fc\u30c8\u3055\u305b\u308b\u307f\u305f\u3044\u3002\u304a\u3063\u3067\u304d\u305d\u3046\u3002<\/p>\n<pre>private void setTimer(){\r\n\r\n    switch(PlayerTurn){\r\n        case(BLACK):\r\n            BlackTimer.setBase(SystemClock.elapsedRealtime() + timeWhenStopped);\r\n            BlackTimer.start();\r\n\r\n            timeWhenStopped = WhiteTimer.getBase() - SystemClock.elapsedRealtime();\r\n            WhiteTimer.stop();\r\n            break;\r\n\r\n        case(WHITE):\r\n            WhiteTimer.setBase(SystemClock.elapsedRealtime() + timeWhenStopped);\r\n            WhiteTimer.start();\r\n\r\n            if(BlackStoneCount + WhiteStoneCount &gt; 5) {\r\n                timeWhenStopped = BlackTimer.getBase() - SystemClock.elapsedRealtime();\r\n                BlackTimer.stop();\r\n            }\r\n            break;\r\n    }\r\n}<\/pre>\n<p>\u3067\u304d\u305f\u3002\u9ed2\u624b\u756a\u304c3\u624b\u76ee\u3050\u3089\u3044\u3067\u6642\u9593\u5909\u306b\u306a\u3063\u3066\u305f\u306e\u30672\u624b\u76ee\u4ee5\u964d\u306btimewhenstopped\u306b\u6642\u9593\u4ee3\u5165\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<p>\u3044\u3064\u304b\u307e\u305f\u3061\u3083\u3093\u3068\u3057\u305f\u30bf\u30a4\u30de\u30fc\u306b\u3082\u6311\u6226\u3057\u3066\u307f\u3088\u3046\u3002<\/p>\n<h3>\u53c2\u8003<\/h3>\n<p><a href=\"https:\/\/so-zou.jp\/mobile-app\/tech\/android\/ui\/widget\/view\/text-view\/chronometer\/\">https:\/\/so-zou.jp\/mobile-app\/tech\/android\/ui\/widget\/view\/text-view\/chronometer\/<\/a><\/p>\n<p><a href=\"https:\/\/techbooster.org\/android\/application\/934\/\">https:\/\/techbooster.org\/android\/application\/934\/<\/a><\/p>\n<p><a href=\"https:\/\/ameblo.jp\/vegetable-it\/entry-11245144566.html\">https:\/\/ameblo.jp\/vegetable-it\/entry-11245144566.html<\/a><\/p>\n<p><a href=\"http:\/\/www.02.246.ne.jp\/~torutk\/javahow2\/timer.html\">http:\/\/www.02.246.ne.jp\/~torutk\/javahow2\/timer.html<\/a><\/p>\n<p><a href=\"https:\/\/blog.mumei-himazin.info\/?p=474\">https:\/\/blog.mumei-himazin.info\/?p=474<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/5594877\/android-chronometer-pause\">https:\/\/stackoverflow.com\/questions\/5594877\/android-chronometer-pause<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c1\u30a7\u30b9\u30af\u30ed\u30c3\u30af\u7684\u306a\u6642\u9593\u8868\u793a\u3092\u3055\u305b\u305f\u3044\u306a\u30fc\u3063\u3066\u601d\u3063\u3066\u305f\u3093\u3060\u3051\u3069\u3001\u6642\u9593\u8a2d\u5b9a\u3068\u304b\u79d2\u8aad\u307f\u3068\u304b\u5207\u308c\u8ca0\u3051\u3068\u304b\u5b9f\u88c5\u3059\u308b\u306e\u3081\u3093\u3069\u304f\u3055\u305d\u3046\u3002\u306a\u306e\u3067\u7d4c\u904e\u6642\u9593\u3060\u3051\u8868\u793a\u3055\u305b\u3088\u3046\u3068\u601d\u3046\u3002 Chronometer \u4e00\u756a\u7c21\u5358\u306a\u306e\u304c\u3053\u308c\u307f\u305f\u3044\u3002\u30c7\u30b6\u30a4\u30f3 &hellip; <a href=\"https:\/\/dalomo.net\/blog\/2018\/11\/24\/174\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[3,6,4,13],"class_list":["post-174","post","type-post","status-publish","format-standard","hentry","category-8","tag-android","tag-androidstudio","tag-4","tag-13"],"_links":{"self":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/comments?post=174"}],"version-history":[{"count":4,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":178,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions\/178"}],"wp:attachment":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/categories?post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/tags?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}