Skip to content

Commit e9bfa4e

Browse files
committed
translate "Stacking Calls with setInterval" in "Ohters" to ja
1 parent 9bab686 commit e9bfa4e

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

doc/ja/other/timeouts.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,20 @@ JavaScriptは非同期なので、`setTimeout`と`setInterval`関数を使って
3131
> 関数が`undefined`になる為に表に出ないエラーになるでしょう。`setTimeout`はどんな
3232
> エラーも発生`させません`
3333
34-
### Stacking Calls with `setInterval`
34+
### `setInterval`でスタッキングコール
3535

36-
While `setTimeout` only runs the function once, `setInterval` - as the name
37-
suggests - will execute the function **every** `X` milliseconds. But its use is
38-
discouraged.
36+
`setTimeout`は関数を一度だけ実行します。`setInterval` - 名前が示すように - **毎回**`X`ミリ秒毎に関数を実行しますが、この使用は推奨されていません。
3937

40-
When code that is being executed blocks the timeout call, `setInterval` will
41-
still issue more calls to the specified function. This can, especially with small
42-
intervals, result in function calls stacking up.
38+
コードがタイムアウト呼び出しブロックで実行される時に、`setInterval`は指定された関数を呼び出します。これは、特に小さい間隔で、関数の結果をスタックに積む事ができます。
4339

4440
function foo(){
45-
// something that blocks for 1 second
41+
// 1秒おきにブロックの何かを実行
4642
}
4743
setInterval(foo, 100);
4844

49-
In the above code `foo` will get called once and will then block for one second.
45+
上記のコードでは、`foo`が1回呼び出されて、1秒ブロックされます。
5046

51-
While `foo` blocks the code `setInterval` will still schedule further calls to
52-
it. Now, when `foo` has finished, there will already be **ten** further calls to
53-
it waiting for execution.
47+
`foo`がコードをブロックしている間、`setInterval`は呼び出される予定を確保しています。`foo`が完了した瞬間に、実行を待っている間に**10回**以上呼び出されている事になります。
5448

5549
### Dealing with Possible Blocking Code
5650

0 commit comments

Comments
 (0)