I wrote up an example program with my ServerMessage and it ran
instantly.. :( The thing is, however, in my main program I put the
following lines before and after the dequeue:
Debug.WriteLine("START DQ: " + DateTime.Now.ToString("mm:ss.fffffff"));
ServerMessage m = (ServerMessage)myQueue.Dequeue();
Debug.WriteLine("END DQ: " + DateTime.Now.ToString("mm:ss.fffffff"));
I know it's a pretty bad way to look at how long things take, but that's
how I got the .2+ second mark... Not sure why it's doing that in my main
program but not the sample one... in the sample one the time between
start and end doesn't change at all.
Jon Skeet [C# MVP] wrote:
Benny Raymond <be***@pocketrocks.com> wrote:
It's currently taking a minimum of .2 seconds for me to dequeue an
object - I'm wondering if it's the dequeue that is taking so long or if
it's just the fact that i'm doing it like this:
retMsg = (ServerMessage)s_messages.Dequeue();
is there a faster way?
That shouldn't take very long at all. Are you absolutely sure that line
is the issue?
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.