Created
May 17, 2019 01:28
-
-
Save Kazunari-h/8d41464ec56753837dc664c41c0267c9 to your computer and use it in GitHub Desktop.
This file contains 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>タイマー処理</title> | |
</head> | |
<body> | |
<script> | |
// 一定秒後に処理を行う! | |
let log = function () { | |
console.log("こんにちは"); | |
}; | |
// setTimeout(log, 3000); // 3秒後に"こんにちは"と表示されます | |
// 仕掛けた setTimeout を無効にする | |
// let timer1 = setTimeout(log, 3000); | |
// clearTimeout(timer1); | |
// 一定秒ごとに処理を行う! | |
// setInterval(log, 3000); // 3秒ごとに"こんにちは"と表示されます | |
// 仕掛けた setInterval を無効にする | |
// let timer2 = setInterval(log, 3000); | |
// clearInterval(timer2); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment