Stopwatch.Start メソッドとは? わかりやすく解説

Stopwatch.Start メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

間隔経過時間計測開始または再開します

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

解説解説
使用例使用例

Stopwatch クラス使用してWindows フォーム アプリケーション開始停止リセット、およびラップタイムの各ボタン実装する例を次に示します。このコード例は、Stopwatch クラストピック取り上げているコード例一部分です。

If stopWatch.IsRunning Then

    ' Stop the timer; show the start and reset buttons.
    stopWatch.Stop()
    buttonStartStop.Text = "Start"
    buttonLapReset.Text = "Reset"
Else
    ' Start the timer; show the stop and lap buttons.
    stopWatch.Start()
    buttonStartStop.Text = "Stop"
    buttonLapReset.Text = "Lap"
    labelLap.Visible = False
    labelLapPrompt.Visible = False
End If
if (stopWatch.IsRunning)
{
    // Stop the timer; show the start and reset buttons.
    stopWatch.Stop();
    buttonStartStop.Text = "Start";
    buttonLapReset.Text = "Reset";
}
else 
{
    // Start the timer; show the stop and lap buttons.
    stopWatch.Start();
    buttonStartStop.Text = "Stop";
    buttonLapReset.Text = "Lap";
    labelLap.Visible = false;
    labelLapPrompt.Visible = false;
}
if ( stopWatch->IsRunning )
{
   // Stop the timer; show the start and reset buttons.
   stopWatch->Stop();
   buttonStartStop->Text = "Start";
   buttonLapReset->Text = "Reset";
}
else
{
   // Start the timer; show the stop and lap buttons.
   stopWatch->Start();
   buttonStartStop->Text = "Stop";
   buttonLapReset->Text = "Lap";
   labelLap->Visible = false;
   labelLapPrompt->Visible = false;
if (stopWatch.get_IsRunning()) {
    // Stop the timer; show the start and reset buttons.
    stopWatch.Stop();
    buttonStartStop.set_Text("Start");
    buttonLapReset.set_Text("Reset");
}
else {
    // Start the timer; show the stop and lap buttons.
    stopWatch.Start();
    buttonStartStop.set_Text("Stop");
    buttonLapReset.set_Text("Lap");
    labelLap.set_Visible(false);
    labelLapPrompt.set_Visible(false);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Stopwatch.Start メソッド」の関連用語

Stopwatch.Start メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Stopwatch.Start メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS