"Alan T" <al*************@yahoo.com.auwrote in message
news:uJ**************@TK2MSFTNGP04.phx.gbl...
Anyone knows how to convert the ticks into seconds or milliseconds?
beginTick = GetTimestamp();
endTick = GetTimestamp();
totalTick = endTick - beginTick;
How many seconds will be the totalTick ?
That depends on your Stopwatch, as the documentation clearly indicates. You
need to look at the Stopwatch.Frequency property to determine how many ticks
there are per second.
IMHO, if what you want is a time with the resolution of seconds or
milliseconds, then it would make more sense to just use the DateTime.Ticks
property. But if you really want to use the Stopwatch class, you can
convert from ticks to seconds simply by dividing the total ticks by the
frequency. Divide that result by 1000 to find milliseconds.
Pete