|
JensKxxx wrote: Wireshark a network protocol analyzer for windows never has such delays.
So you are comparing your code to WireShark's? Seeing it's open source, why dont you look what they are doing? What took a team of developers years to do, you think you are capable in doing in a few lines? Try again. Maybe you should run the process on another thread, just a hint, sure you wont need it.
|
|
|
|
|
|
The stopwatch class calls QueryPerformanceCounter, and that is about as low resolution you can get. You can use the multimedia timer too for a resolution of 1ms, and much less latency.
|
|
|
|
|
I think that you are experiencing that a different process is using it's entire time slot before your process gets the control back.
When the request is sent and you are waiting for the response, it's most likely doing a Thread.Sleep(0) to give up the rest of each time slot (as there is no reson to check for a response 100000000 times a second). Most of the time all other processes are also waiting for something, so you will get the control back within a few ms or so, but if some other process is doing a lot of work it can take longer before you can check for a response again.
What you are measuring is not how long time it actually takes to get a response, but how long time it takes until your program notices the response. If you want to measure the actual response time you have to do it in a different way, like hooking up something in the IP stack.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
It's a simple case of, he is running on a GUI thread, and he clearly does not realise the Windows Message loop has overhead.
|
|
|
|
|
Am trying to make the label's text to the current time, but not using the 'static' DateTime.Now property which I tried to use lately.
How can I go about it.Please help.
|
|
|
|
|
Use BackGroundWroker Process (i.e. a different thread) to update the time on label after every 1 sec(or whatever interval you like)
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You could use the Timer class, which is simpler than explicitly creating another process:
protected Timer tim = new Timer();
...
tim.Tick += new EventHandler(tim_Tick);
tim.Interval = timerInterval;
...
private void tim_Tick(object sender, EventArgs e)
{
}
|
|
|
|
|
avoid using threads to update your gui , insted use events .
also you can use DateTime.Now to get the time
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
I have threads update my GUI all the time, but they have to be done properly.
I don't see how an event would help avoid using a thread.
|
|
|
|
|
System.Nvarchar does not exist... does anyone know how to do this?
bulkCopy.WriteToServer throws an exception because it cannot put a string into nvarchar...
dc.DataType = System.Type.GetType("System.Nvarchar");
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Mogaambo wrote: System.Nvarchar does not exist
Where did you read that it is a datataype in .Net?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Probably his MySQL or Oracle book
|
|
|
|
|
The DataType should be System.String .
|
|
|
|
|
try this:
SqlDbType.NVarChar
I want to fly but I don't have wings
|
|
|
|
|
System.String and SqlDbType.NVarChar , doesn't work it gives exception.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Hello
I'm currently using SMTP to send mail with attachement from my csharp app
But I also need to let the user add some coments, so the best will be to send the mail via the mail client
I see that mailto: do not allow to sent attachement
I'm looking around Mapi but I do not find any relevant help
Do someone have a suggestion for me ?
Thank you very much
|
|
|
|
|
If you're using SMTP, why can't you simply add a small window to your project where user can add his/hers comments?
|
|
|
|
|
Thank you Mika
But since it might be possible to send using MAPI I want to find out how !
|
|
|
|
|
|
|
I'm already using SMTP !!
|
|
|
|
|
In my application,i have changed the color of text(SyntaxHighLighting), it is working fine,But whenever any one press Ctrl+Z, it undo-operations on my highlighting operations(The most recent operation).
For the solution of this problem:
I have used ClearUndo() but it clears whole undo stack while in the description of this function wrote,clear most recently undo operation.
If you have any solution of this problem,Please suggest().
Can we suspend/Disable/Off Undo or any other way to do the things?
|
|
|
|
|
khaleek wrote: Can we suspend/Disable/Off Undo or any other way to do the things?
Nope - you can't suspend it. What you could do is roll your own undo manager, but this would not be trivial. Alternatively, you can always reapply the syntax highlighting immediately following the undo operation.
|
|
|
|
|
If I have to Undo the Text that was typed just before Syntax Highlight, than we will never able to do the same.
|
|
|
|