Losing leading zeros in timespan

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hi,

using .NET 1.1 C#

I am trying to determine page generation time. I have
TimeSpan RenderTime = DateTime.Now - PageTime; (pagetime was set up in
oninit, Rendertime is in the render

I am using RenderTime.Seconds and RenderTime.Milliseconds in my string. (In
the brackets is just RenderTime, so that you can see the correct value)

Here is the output from my timespan.
This page was rendered in 0.46 seconds (00:00:00.0468750)

How do I ensure that milliseconds doesn't lose the leading zero? I guess
that I am going to have to do something like...

(1000 - (1000 - RenderTime.Milliseconds)), Is this my only option?

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
I tried the option I have written here. It didn't work. Same number appears.
:-(

Any idea how I can keep the leading zeros? Typically, I have found my page
renders in 0.05 seconds (or thereabouts), but the rendered time is showing
0.5 seconds, which is not correct. Whilst I think 0.5 seconds is still fast,
it is not a real representation of the time. (In fact, the time surprised
me. 5 tenths of a second. Wow)

Anyone have any ideas?

I suppose I could try TotalMilliseconds / 1000 but I am guessing I will have
the exact same issue.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
Back
Top