TimeSpan

  • Thread starter Thread starter Lou
  • Start date Start date
L

Lou

any good examples of using this
I need to check amount of seconds elapsed from a certain point

something like this (But this doesn't work)
DateTime markTime = DateTime.Now;

if(DateTime.Compare(markTime,DateTime.Now) >= 5){

FetchEvents();

How do i suggest minutes or seconds???



-Lou
 
DateTime start = DateTime.Now;

... do something

DateTime end = DateTime.Now;

TimeSpan interval = end - start;

double durationMs = interval.TotalMilliseconds;
 
Lou said:
What are "end" and "start" ?
are these declared as variables???

Yes - they are declared and initialized in the code that john farrow
posted...
 
Back
Top