You can use a Stopwatch
object to measure time. Start
the Stopwatch
and then get the Elapsed
time when you want to make the first measurement. You can assign that value to a variable. You could let it keep running and take another measurement later and subtract the first from the second, or you could Reset
it and get the second time directly from Elapsed
again.