I've added ICQ# library (it's open source) to my application. But if I connect to ICQ server though it, it will increase usage of CPU (up to 30%). So something in ICQ# library is using CPU so much. But I don't know how to determinate what is it and reduce the usage of CPU.
Asked
Active
Viewed 144 times
3 Answers
2
If it's open source and you've added the code to your project; run it with a profiler attached.

Rob P.
- 14,921
- 14
- 73
- 109
-
I've found that, VS already contains this (ALT+F2). Thanks. There was while loop with `DateTime.Now` and calling this method in loop takes so much CPU time. – sczdavos Nov 12 '12 at 19:11
0
The very simplest approach is this:
- Run your program in the debugger.
- And break into the debugger at some point.
- Look at the call stack wherever you are
- repeat steps 2-3
Doing this just two or three times gives you a very good idea of where most of your execution time is being spent. If most of the execution time is spent in one function, then that function will be on the call stack nearly every time you break into the debugger.

jalf
- 243,077
- 51
- 345
- 550
0
I find it in 'icq_sharp\IcqSharp.Util\Timer.cs' file.
See function: private void DoWorker()
. There is a loop without delay.
Just add Thread.Sleep(10);

jauseg
- 111
- 1
- 4