本文整理汇总了C#中Stopwatch.GetDurationInMilliseconds方法的典型用法代码示例。如果您正苦于以下问题:C# Stopwatch.GetDurationInMilliseconds方法的具体用法?C# Stopwatch.GetDurationInMilliseconds怎么用?C# Stopwatch.GetDurationInMilliseconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stopwatch
的用法示例。
在下文中一共展示了Stopwatch.GetDurationInMilliseconds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartWriting
private void StartWriting(object sender, EventArgs e)
{
resultView.Text = "";
stopwatch = new Stopwatch();
stopwatch.Start();
fileAccessService.WriteToFile(fileName, contentToWrite);
stopwatch.Stop();
timeLabel.Text = stopwatch.GetDurationInMilliseconds();
}
示例2: StartWriting
partial void StartWriting(UIButton sender)
{
resultView.Text = "";
stopwatch = new Stopwatch();
stopwatch.Start();
fileAccessService.WriteToFile(fileName, contentToWrite);
stopwatch.Stop();
timeLabel.Text = stopwatch.GetDurationInMilliseconds();
}
示例3: StartReading
private void StartReading(object sender, EventArgs e)
{
resultView.Text = "";
stopwatch = new Stopwatch();
stopwatch.Start();
var fileContents = fileAccessService.ReadFromFile(fileName);
stopwatch.Stop();
resultView.Text = fileContents;
timeLabel.Text = stopwatch.GetDurationInMilliseconds();
}
示例4: StartReading
partial void StartReading(UIButton sender)
{
resultView.Text = "";
stopwatch = new Stopwatch();
stopwatch.Start();
var fileContents = fileAccessService.ReadFromFile(fileName);
stopwatch.Stop();
resultView.Text = fileContents;
timeLabel.Text = stopwatch.GetDurationInMilliseconds();
}