チャネル
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="s">「fmt」を</span><span class="k">インポート</span> <span class="c">// Slieceとチャネルを扱う関数</span> <span class="k">FUNC </span> <span class="n">gorooutine1 </span><span class="p">(</span><span class="n">S </span> <span class="p">[] </span><span class="kt">INT </span><span class="p">、</span> <span class="n">C </span> <span class="k">ちゃん</span> <span class="kt">INT </span><span class="p">)</span> <span class="p">{ </span> <span class="n">合計</span> <span class="o">:= </span> <span class="m">0 </span> <span class="k">のため</span> <span class="n">_ </span><span class="p">、</span> <span class="n">V </span> <span class="o">:= </span> <span class="k">範囲</span> <span class="n">S </span> <span class="p">{ </span> <span class="n">和</span> <span class="o">+ = </span> <span class="n">V </span> <span class="p">} </span> <span class="c">// < -チャネルに送信</span> <span class="n">C </span> <span class="o">< - </span> <span class="n">合計</span> <span class="p">}</span> <span class="k">FUNC </span> <span class="n">メイン</span><span class="p">()</span> <span class="p">{ </span> <span class="n">S </span> <span class="o">:= </span> <span class="p">[] </span><span class="kt">INT </span><span class="p">{ </span><span class="m">1 </span><span class="p">、</span> <span class="m">2 </span><span class="p">、</span> <span class="m">3 </span><span class="p">、</span> <span class="m">4 </span><span class="p">、</span> <span class="m">5 </span><span class="p">} </span> <span class="c">//チャネル整数を扱う</span> <span class="n">C </span> <span class="o">:= </span> <span class="nb">メイク</span><span class="p">(</span><span class="k">チャン</span> <span class="kt">INT </span><span class="p">)</span> <span class="k">行く</span> <span class="n">gorooutine1 </span><span class="p">(</span><span class="n">S </span><span class="p">、</span> <span class="n">Cの</span><span class="p">)</span> <span class="c">// < - Cでチャネルから受け取るまで待機</span> <span class="n">x </span> <span class="o">:= </span> <span class="o">< </span><span class="n">-c </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="n">x </span><span class="p">)</span> <span class="p">}</span> |
1 |
15 |
キューのような使い方
- 2つのチャンネルを並列実行しても2つの処理の実行を待つ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="s">「fmt」を</span><span class="k">インポート</span> <span class="c">// Slieceとチャネルを扱う関数</span> <span class="k">FUNC </span> <span class="n">gorooutine1 </span><span class="p">(</span><span class="n">S </span> <span class="p">[] </span><span class="kt">INT </span><span class="p">、</span> <span class="n">C </span> <span class="k">ちゃん</span> <span class="kt">INT </span><span class="p">)</span> <span class="p">{ </span> <span class="n">合計</span> <span class="o">:= </span> <span class="m">0 </span> <span class="k">のため</span> <span class="n">_ </span><span class="p">、</span> <span class="n">V </span> <span class="o">:= </span> <span class="k">範囲</span> <span class="n">S </span> <span class="p">{ </span> <span class="n">和</span> <span class="o">+ = </span> <span class="n">V </span> <span class="p">} </span> <span class="c">// < -チャネルに送信</span> <span class="n">C </span> <span class="o">< - </span> <span class="n">合計</span> <span class="p">}</span> <span class="k">FUNC </span> <span class="n">gorooutine2 </span><span class="p">(</span><span class="n">S </span> <span class="p">[] </span><span class="kt">INT </span><span class="p">、</span> <span class="n">C </span> <span class="k">ちゃん</span> <span class="kt">INT </span><span class="p">)</span> <span class="p">{ </span> <span class="n">合計</span> <span class="o">:= </span> <span class="m">0 </span> <span class="k">のため</span> <span class="n">_ </span><span class="p">、</span> <span class="n">V </span> <span class="o">:= </span> <span class="k">範囲</span> <span class="n">S </span> <span class="p">{ </span> <span class="n">和</span> <span class="o">+ = </span> <span class="n">V </span> <span class="p">} </span> <span class="c">// < -チャネルに送信</span> <span class="n">C </span> <span class="o">< - </span> <span class="n">和</span> <span class="p">}</span> <span class="k">FUNC </span> <span class="n">メイン</span><span class="p">()</span> <span class="p">{ </span> <span class="n">S </span> <span class="o">:= </span> <span class="p">[] </span><span class="kt">INT </span><span class="p">{ </span><span class="m">1 </span><span class="p">、</span> <span class="m">2 </span><span class="p">、</span> <span class="m">3 </span><span class="p">、</span> <span class="m">4 </span><span class="p">、</span> <span class="m">5 </span><span class="p">} </span> <span class="c">//チャネル整数を扱う</span> <span class="n">C </span> <span class="o">:= </span> <span class="nb">メイク</span><span class="p">(</span><span class="k">チャン</span> <span class="kt">INT </span><span class="p">)</span> <span class="k">行く</span> <span class="n">gorooutine1 </span><span class="p">(</span><span class="n">S </span><span class="p">、</span> <span class="n">C </span><span class="p">)</span> <span class="k">に行く</span> <span class="n">gorooutine2を</span><span class="p">(</span><span class="n">S </span><span class="p">、</span> <span class="n">C </span><span class="p">)</span> <span class="c">// <-cでチャネルから受け取るまで待機</span> <span class="n">x </span> <span class="o">:= </span> <span class="o">< </span><span class="n">-c </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="n">x </span><span class="p">)</span> <span class="n">y </span> <span class="o">:=</span> <span class="o">< </span><span class="n">-c </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="n">y </span><span class="p">)</span> <span class="p">}</span> |
1 2 |
15 15 |
バッファ付きチャネル
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="s">「fmt」を</span><span class="k">インポート</span> <span class="k">func </span> <span class="n">main </span><span class="p">()</span> <span class="p">{ </span> <span class="n">ch </span> <span class="o">:= </span> <span class="nb">make </span><span class="p">(</span><span class="k">chan </span> <span class="kt">int </span><span class="p">、</span> <span class="m">2 </span><span class="p">)</span> <span class="n">ch </span> <span class="o">< </span> <span class="m">-100 </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="nb">len </span><span class="p">(</span><span class="n">ch </span><span class="p">))</span> <span class="n">ch </span> <span class="o">< </span> <span class="m">-200 </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="nb">len </span><span class="p">(</span><span class="n">ch </span><span class="p">))</span> <span class="c">// rangeで</span> <span class="n">後続</span><span class="c">場合はcloseしないと次のChannelを呼ぼうとしてエラーになる</span><span class="nb">close </span><span class="p">(</span><span class="n">ch </span><span class="p">)</span> <span class="c">// forで1つづつルーティング</span> <span class="k">for </span> <span class="n">c </span> <span class="o">:= </span> <span class="k">range </span> <span class="n">ch </span> <span class="p">{ </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="n">c </span><span class="p">)</span> <span class="p">} </span> <span class="p">}</span> |
1 2 3 4 |
1 2 100 200 |
チャネルの範囲、閉じる
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="s">「fmt」を</span><span class="k">インポート</span> <span class="k">FUNC </span> <span class="n">goroutine1 </span><span class="p">(</span><span class="n">S </span> <span class="p">[] </span><span class="kt">INT </span><span class="p">、</span> <span class="n">C </span> <span class="k">ちゃん</span> <span class="kt">INT </span><span class="p">)</span> <span class="p">{ </span> <span class="n">合計</span> <span class="o">:= </span> <span class="m">0 </span> <span class="k">のため</span> <span class="n">_ </span><span class="p">、</span> <span class="n">V </span> <span class="o">:= </span> <span class="k">範囲</span> <span class="n">S </span> <span class="p">{ </span> <span class="n">和</span> <span class="o">+ = </span> <span class="n">V </span> <span class="n">C </span> <span class="o">< - </span> <span class="n">和</span> <span class="p">} </span> <span class="c">//処理完了後は近くを入れる</span> <span class="nb">近い</span><span class="p">(</span><span class="n">C </span><span class="p">)</span> <span class="p">}</span> <span class="k">FUNC </span> <span class="n">メイン</span><span class="p">()</span> <span class="p">{ </span> <span class="n">S </span> <span class="o">:= </span> <span class="p">[] </span><span class="kt">INT </span><span class="p">{ </span><span class="m">1 </span><span class="p">、</span> <span class="m">2 </span><span class="p">、</span> <span class="m">3 </span><span class="p">、</span> <span class="m">4 </span><span class="p">、</span> <span class="m">5 </span><span class="p">} </span> <span class="n">、C </span> <span class="o">:= </span> <span class="nb">メイク</span><span class="p">(</span><span class="k">チャン</span> <span class="kt">INT </span><span class="p">、</span> <span class="nb">lenの</span><span class="p">(</span><span class="n">S </span><span class="p">))</span> <span class="k">に行く</span> <span class="n">goroutine1 </span><span class="p">(</span><span class="n">S </span><span class="p">、</span> <span class="n">C </span><span class="p">)</span> <span class="c">//チャネルを1回ずつ呼び出します</span> <span class="k">for </span> <span class="n">i </span> <span class="o">:= </span> <span class="k">range </span> <span class="n">c </span> <span class="p">{ </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="n">i </span><span class="p">)</span> <span class="p">} </span> <span class="p">}</span> |
1 2 3 4 5 |
1 3 6 10 15 |
プロデューサーコンシューマー
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="k">インポート</span> <span class="p">(</span> <span class="s">"fmt" </span> <span class="s">"sync" </span> <span class="s">"time" </span> <span class="p">)</span> <span class="k">func </span> <span class="n">プロデューサー</span><span class="p">(</span><span class="n">ch </span> <span class="k">chan </span> <span class="kt">int </span><span class="p">、</span> <span class="n">i </span> <span class="kt">int </span><span class="p">)</span> <span class="p">{ </span> <span class="c">//何か</span> <span class="n">ch </span> <span class="o">< </span> <span class="n">-i </span> <span class="o">* </span> <span class="m">2 </span> <span class="p">}</span> <span class="k">FUNCの</span> <span class="n">消費者</span><span class="p">(</span><span class="n">CH </span> <span class="k">ちゃん</span> <span class="kt">INT </span><span class="p">、</span> <span class="n">WG </span> <span class="o">* </span><span class="n">同期</span><span class="o">。</span><span class="n">WaitGroup </span><span class="p">)</span> <span class="p">{ </span> <span class="k">用</span> <span class="n">I </span> <span class="o">:= </span> <span class="k">レンジ</span> <span class="n">CH </span> <span class="p">{ </span> <span class="k">FUNC </span><span class="p">()</span> <span class="p">{ </span> <span class="n">FMT </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="s">"process" </span><span class="p">、</span> <span class="n">i </span><span class="o">* </span><span class="m">1000 </span><span class="p">)</span> <span class="n">wg </span><span class="o">。</span><span class="n">完了</span><span class="p">()</span> <span class="p">}()</span> <span class="p">} </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="s">"#################################" </span><span class="p">)</span> <span class="p">}</span> <span class="k">func </span> <span class="n">main </span><span class="p">()</span> <span class="p">{ </span> <span class="k">var </span> <span class="n">wg </span> <span class="n">sync </span><span class="o">。</span><span class="n">WaitGroup </span> <span class="n">ch </span> <span class="o">:= </span> <span class="nb">make </span><span class="p">(</span><span class="k">chan </span> <span class="kt">int </span><span class="p">)</span> <span class="c">//プロデューサー</span> <span class="k">for </span> <span class="n">i </span> <span class="o">:= </span> <span class="m">0 </span><span class="p">; </span> <span class="n">i </span> <span class="o">< </span> <span class="m">10 </span><span class="p">; </span> <span class="n">i </span><span class="o">++ </span> <span class="p">{ </span> <span class="n">wg </span><span class="o">。</span><span class="n">add </span><span class="p">(</span><span class="m">1 </span><span class="p">)</span> <span class="k">go </span> <span class="n">プロデューサー</span><span class="p">(</span><span class="n">ch </span><span class="p">、</span> <span class="n">i </span><span class="p">)</span> <span class="p">}</span> <span class="c">//消費者</span> <span class="k">、外出先の</span> <span class="n">消費者</span><span class="p">(</span><span class="n">CH </span><span class="p">、</span> <span class="o">&</span><span class="n">WG </span><span class="p">)</span> <span class="n">WG </span><span class="o">。</span><span class="n">待機</span><span class="p">()</span> <span class="nb">クローズ</span><span class="p">(</span><span class="n">ch </span><span class="p">)</span> <span class="n">時間</span><span class="o">。</span><span class="n">スリープ</span><span class="p">(</span><span class="m">2 </span> <span class="o">* </span> <span class="n">時間</span><span class="o">。</span><span class="n">秒</span><span class="p">)</span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="s">"完了" </span><span class="p">)</span> <span class="p">}</span> |
1 2 3 4 5 6 7 8 9 10 11 12 |
プロセス0 プロセス4000 プロセス2000 プロセス6000 プロセス8000 プロセス10000 プロセス12000 プロセス14000 プロセス16000 プロセス18000 ################################# できた |
ファンアウトファンイン
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="s">「fmt」を</span><span class="k">インポート</span> <span class="k">func </span> <span class="n">producer </span><span class="p">(</span><span class="n">first </span> <span class="k">chan </span> <span class="kt">int </span><span class="p">)</span> <span class="p">{ </span> <span class="k">defer </span> <span class="nb">close </span><span class="p">(</span><span class="n">first </span><span class="p">)</span> <span class="k">for </span> <span class="n">i </span> <span class="o">:= </span> <span class="m">0 </span><span class="p">; </span> <span class="n">i </span> <span class="o">< </span> <span class="m">10 </span><span class="p">; </span> <span class="n">i </span><span class="o">++ </span> <span class="p">{ </span> <span class="n">最初</span> <span class="o">< </span> <span class="n">-i </span> <span class="p">} </span> <span class="p">}</span> <span class="k">func </span> <span class="n">multi2 </span><span class="p">(</span><span class="n">first </span> <span class="k">chan </span> <span class="kt">int </span><span class="p">、</span> <span class="n">second </span> <span class="k">chan </span> <span class="kt">int </span><span class="p">)</span> <span class="p">{ </span> <span class="k">defer </span> <span class="nb">close </span><span class="p">(</span><span class="n">second </span><span class="p">)</span> <span class="k">for </span> <span class="n">i </span> <span class="o">:= </span> <span class="k">range </span> <span class="n">first </span> <span class="p">{ </span> <span class="c">// 1 * 2 = 2 </span> <span class="c">// 2 * 2 = 4 </span> <span class="n">second </span> <span class="o">< </span> <span class="n">-i </span> <span class="o">* </span> <span class="m">2 </span> <span class="p">} </span> <span class="p">}</span> <span class="k">func </span> <span class="n">multi4 </span><span class="p">(</span><span class="n">second </span> <span class="k">chan </span> <span class="kt">int </span><span class="p">、</span> <span class="n">third </span> <span class="k">chan </span> <span class="kt">int </span><span class="p">)</span> <span class="p">{ </span> <span class="k">defer </span> <span class="nb">close </span><span class="p">(</span><span class="n">third </span><span class="p">)</span> <span class="k">for </span> <span class="n">i </span> <span class="o">:= </span> <span class="k">range </span> <span class="n">second </span> <span class="p">{ </span> <span class="c">// 2 * 4 = 8 </span> <span class="c">// 4 * 4 = 4 </span> <span class="n">third </span> <span class="o">< </span> <span class="n">-i </span> <span class="o">* </span> <span class="m">4 </span> <span class="p">} </span> <span class="p">}</span> <span class="k">func </span> <span class="n">main </span><span class="p">()</span> <span class="p">{</span> <span class="n">最初</span> <span class="o">:= </span> <span class="nb">make </span><span class="p">(</span><span class="k">chan </span> <span class="kt">int </span><span class="p">)</span> <span class="n">2番目</span> <span class="o">:= </span> <span class="nb">make </span><span class="p">(</span><span class="k">chan </span> <span class="kt">int </span><span class="p">)</span> <span class="n">3番目</span> <span class="o">:= </span> <span class="nb">make </span><span class="p">(</span><span class="k">chan </span> <span class="kt">int </span><span class="p">)</span> <span class="k">go </span> <span class="n">プロデューサー</span><span class="p">(</span><span class="n">最初</span><span class="p">)</span> <span class="k">go </span> <span class="n">multi2 </span><span class="p">(</span><span class="n">最初</span><span class="p">、</span> <span class="n">2番目</span><span class="p">)</span> <span class="k">go </span> <span class="n">multi4 </span><span class="p">(</span><span class="n">2番目</span><span class="p">、</span> <span class="n">3番目</span><span class="p">)</span> <span class="k">for </span> <span class="n">result </span> <span class="o">:= </span> <span class="k">range </span> <span class="n">third </span> <span class="p">{ </span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="n">結果</span><span class="p">)</span> <span class="p">} </span> <span class="p">}</span> |
1 2 3 4 5 6 7 8 9 10 |
0 8 16 24 32 40 48 56 64 72 |
選択する
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="k">インポート</span> <span class="p">(</span> <span class="s">"fmt" </span> <span class="s">"time" </span> <span class="p">)</span> <span class="k">func </span> <span class="n">goroutine1 </span><span class="p">(</span><span class="n">ch </span> <span class="k">chan </span> <span class="kt">string </span><span class="p">)</span> <span class="p">{ </span> <span class="k">for </span> <span class="p">{ </span> <span class="n">ch </span> <span class="o"><- </span> <span class="s">"packat from 1" </span> <span class="n">time </span><span class="o">。</span><span class="n">スリープ</span><span class="p">(</span><span class="m">3 </span> <span class="o">* </span> <span class="n">時間</span><span class="o">。</span><span class="n">秒</span><span class="p">)</span> <span class="p">} </span> <span class="p">}</span> <span class="k">func </span> <span class="n">goroutine2 </span><span class="p">(</span><span class="n">ch </span> <span class="k">chan </span> <span class="kt">string </span><span class="p">)</span> <span class="p">{ </span> <span class="k">for </span> <span class="p">{ </span> <span class="n">ch </span> <span class="o"><- </span> <span class="s">"packat from 2" </span> <span class="n">time </span><span class="o">。</span><span class="n">スリープ</span><span class="p">(</span><span class="m">1 </span> <span class="o">* </span> <span class="n">時間</span><span class="o">。</span><span class="n">秒</span><span class="p">)</span> <span class="p">} </span> <span class="p">}</span> <span class="k">func </span> <span class="n">main </span><span class="p">()</span> <span class="p">{ </span> <span class="n">c1 </span> <span class="o">:= </span> <span class="nb">make </span><span class="p">(</span><span class="k">chan </span> <span class="kt">string </span><span class="p">)</span> <span class="n">c2 </span> <span class="o">:= </span> <span class="nb">make </span><span class="p">(</span><span class="k">chan </span> <span class="kt">string </span><span class="p">)</span> <span class="k">go </span> <span class="n">goroutine1 </span><span class="p">(</span><span class="n">c1 </span><span class="p">)</span> <span class="k">go </span> <span class="n">goroutine2 </span><span class="p">(</span><span class="n">c2 </span><span class="p">)</span> <span class="k">以下のために</span> <span class="p">{ </span> <span class="k">選択</span> <span class="p">{ </span> <span class="k">ケース</span> <span class="n">MSG1 </span> <span class="o">= </span> <span class="o">- < </span><span class="n">C1 </span><span class="o">:</span> <span class="n">FMTを</span><span class="o">。</span><span class="n">println </span><span class="p">(</span><span class="n">MSG1 </span><span class="p">)</span> <span class="k">場合</span> <span class="n">MSG2 </span> <span class="o">:= </span> <span class="o">< - </span><span class="n">C2 </span><span class="o">:</span> <span class="n">FMT </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="n">msg2 </span><span class="p">)</span> <span class="p">} </span> <span class="p">} </span> <span class="p">}</span> |
1 2 3 4 5 6 7 8 |
1からのpackat 2からのpackat 2からのpackat 2からのpackat 1からのpackat 2からのpackat 2からのpackat 2からのpackat |
デフォルトセクション
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<span class="k">パッケージ</span> <span class="n">メイン</span> <span class="k">インポート</span> <span class="p">(</span> <span class="s">"fmt" </span> <span class="s">"time" </span> <span class="p">)</span> <span class="k">func </span> <span class="n">main </span><span class="p">()</span> <span class="p">{ </span> <span class="n">tick </span> <span class="o">:= </span> <span class="n">time </span><span class="o">。</span><span class="n">ティック</span><span class="p">(</span><span class="m">100 </span> <span class="o">* </span> <span class="n">時間</span><span class="o">。</span><span class="n">ミリ秒</span><span class="p">)</span> <span class="n">ブーム</span> <span class="o">:= </span> <span class="n">時間</span><span class="o">。</span><span class="n">後</span><span class="p">(</span><span class="m">500 </span> <span class="o">* </span> <span class="n">時間</span><span class="o">。</span><span class="n">ミリ秒</span><span class="p">)</span> <span class="k">以下のために</span> <span class="p">{ </span> <span class="k">選択</span> <span class="p">{ </span> <span class="c">// 100Millisocond毎</span> <span class="k">場合</span> <span class="o">- < </span><span class="n">ダニ</span><span class="o">:</span> <span class="n">FMTを</span><span class="o">。</span><span class="n">println </span><span class="p">(</span><span class="s">"ダニ" </span><span class="p">)</span> <span class="c">// 500Millisocond毎</span> <span class="k">場合</span> <span class="o">< - </span><span class="n">ブーム</span><span class="o">:</span> <span class="n">FMT </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="s">"BOOM" </span><span class="p">)</span> <span class="c">// loop終了</span> <span class="k">return </span> <span class="c">//それ以外は</span> <span class="n">ピリオド</span><span class="k">デフォルト</span><span class="o">:</span> <span class="n">fmt </span><span class="o">。</span><span class="n">Println </span><span class="p">(</span><span class="s">"。" </span><span class="p">)</span> <span class="n">時間</span><span class="o">。</span><span class="n">スリープ</span><span class="p">(</span><span class="m">50 </span> <span class="o">* </span> <span class="n">時間</span><span class="o">。</span><span class="n">ミリ秒</span><span class="p">)</span> <span class="p">} </span> <span class="p">} </span> <span class="p">}</span> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
。 。 ダニ、 。 。 ダニ、 。 。 ダニ、 。 。 ダニ、 。 。 ダニ、 ブーム |