let’s say you would like to measure the time from 1 point in time to another.

The solution is to use TimeSpan in C#

Like this:

            var timeSpan1 = new TimeSpan(1, 2, 3); // 1 hour 2 min 3 secs

            var start1 = DateTime.Now; // get the actual time
            var end1 = DateTime.Now.AddMinutes(2); // Add 2 minuts
            var duration1 = end1 - start1; // duration is the difference between the 2 timespans

           

Basically duration1, is a timeSpan that contains the difference between 2 different times, in this case is only 2 minutes, just to show the example.