0

I have a resource file -stringsCommon0.resx

it is 1320 lines

for reading a resource I'm using the following code

DateTime time1 = DateTime.Now;

string strResult = Resources.stringsCommon0.ResourceManager.GetString(stringName);                

DateTime time2 = DateTime.Now;

double mil = (time2 - time1).TotalMilliseconds;

when i look mil it gives results between 15 and 17,

i think it is very big number since in my application i always read it from stringsCommon0 by the code believe.

by the time the values is getted while debugging.

what should i do now? Are the results normal? what else should i do for multilinguality?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
brtb
  • 2,201
  • 6
  • 34
  • 53
  • Do the measurement twice in the same program, and tell us the second result. I think that only the first access is slow, and the rest should be faster. – fejesjoco Dec 10 '14 at 21:46
  • @fejesjoco no in the first time i get 107 milisecond after than it give 16 milisecond every time. – brtb Dec 10 '14 at 21:49
  • 1
    Also, you should use the [`Stopwatch` class](http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx) for measuring elapsed time, not `DateTime`. – John Saunders Dec 10 '14 at 21:59

0 Answers0