Stopwatch.Restart 方法

定義

停止時間間隔測量,並將耗用時間重設為零,然後開始測量耗用時間。Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.

public:
 void Restart();
public void Restart ();
member this.Restart : unit -> unit
Public Sub Restart ()

備註

Stopwatch實例會計算並保留跨多個時間間隔的累計經過時間,直到實例重設或重新開機為止。A Stopwatch instance calculates and retains the cumulative elapsed time across multiple time intervals, until the instance is reset or restarted. 使用 Stop 以停止目前的間隔測量,並保留累積的經過時間值。Use Stop to stop the current interval measurement and retain the cumulative elapsed time value. Reset 來停止進行中的任何間隔測量,並清除經過時間值。Use Reset to stop any interval measurement in progress and clear the elapsed time value. 使用 Restart 以停止目前的間隔測量,並開始新的間隔測量。Use Restart to stop current interval measurement and start a new interval measurement.

適用於