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.

适用于