StopWatch(System.Diagnostics)和System.Timers

use*_*973 2 c# multithreading operations timer

我是处理线程的新手.

System.Diagnostics和System.Timers在线程上下文中的作用是什么?两者是相互替代的还是他们为执行一些独特的任务而实施的?

spe*_*der 11

StopWatch用于测量时间间隔.定时器用于调度在将来的某个时刻执行的方法.它们完全不同.