C#方法执行时花费更多时间
问题描述:
大家好,
你能帮我这个忙吗?
我有一种C#方法,执行时花了更多时间,我想减少执行时间,该怎么做,请帮帮我.
如果我可以使用多线程,如何使用plase,请告知我.
告诫您,
问候,
Narasimha
Hi All,
Can you please help me on this .
I have one c# method it is taking more time while execution i want to reduce the time of excution how to do this please help me.
If i can use multithreading how to i can use plase let me know on this.
Advcanced thak you,
Regards,
Narasimha
答
请详细说明您要在方法内部执行的操作?"
多线程有助于克服缓慢的任务,但并非总是解决方案.
同时,您还可以检查一些优化技巧 [ ^ ]
在这种情况下,我首先要寻找的是关闭那些IO句柄,任何非托管对象等,这些东西我可能在不知不觉中一直保持打开状态.
Please mention detail about ''What you are trying to do inside method?''
Multi-Threading is helpful to overcome slow tasks, but not always the solution.
Meanwhile, you can also check some Optimization Tips[^]
In such case, what I first look for is closing those IO handles, any unmanaged objects, etc which I might have unknowingly kept open.