1

I want to set a StopWatch starting time from a specific time.

I calculate a TimeSpan.FromMilliseconds(frames*128) (each frame shown every 128 milliseconds).

Than I proceed as follows:

var timeSpan = TimeSpan.FromMilliseconds(TimeFrame*128);
//e.g. 3762*128ms = 00h:08m:01s:5630ms

var offsetTimeSpan = new TimeSpan(0,0,timeSpan.Minutes,timeSpan.Seconds,timeSpan.Milliseconds).Add(_timeStopWatch.Elapsed);

_timeStopWatch.Start();

I used a methond specified by @Big T (link). However the StopWatch seems to start from 00:00:00. How should it be done properly?

Community
  • 1
  • 1
Georgiana M
  • 323
  • 4
  • 20
  • Stopwatch is used for measuring time duration elapsed. Why would you want to start it from a specified time. Actually it starts from the current time and that's how you measure elapsed time normally. – Chetan Jan 08 '17 at 03:24

0 Answers0