Losing leading zeros in timespan

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
 
D

David

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top