From: Ian McCutcheon on
I was wondering if anyone has run into this. The following uses C# with .net
compact framework 3.5 running on WinCE 6.0 R2.

I have a string builder and am using it to build a string that contains the
current date and time. I get the date and time using:

System.DateTime currTime = System.DateTime.Now;

I then format it into my string builder as follows:

dateTimeString.Length = 0;
dateTimeString.Append(currTime.ToString("MMM dd yy "));

Now the above will not show any boxing in the remote performance monitor
(see field Boxed Value Types). But if I change the format string to (year
from yy to yyyy)

dateTimeString.Length = 0;
dateTimeString.Append(currTime.ToString("MMM dd yyyy "));


Now I get a value of 1 reported for boxing. The IL does not show any box
operation so I'm assuming it is coming from the .ToString method (and this
assumes that the RPM tracks those that occur in the .NetCF too which I am not
sure about).

Has anyone else experienced this and found a work around. I realize one box
operation is pretty minor in the grand scheme of things but found it
interesting at least.

 | 
Pages: 1
Prev: windows mobile & dbf
Next: Auto update app