multithreading - c# - How to stop a timer Immediately -


i have system.timers.timer 100 interval. question if set enable = false in timer, current working process in timer method stop immediately? or after method finished.

private void watchtags(object obj, elapsedeventargs handler)     {         for(int i=0 ; i<10000;i++){             // works         }     } private void stop_button(){     watcher.enabled = false; } 

is loop stop or after finish?

doing timer.enabled = false stop timer. same timer.stop();

timer.enabled = false = system.threading.timer or system.timers.timer

timer.stop(); =system.windows.forms.timer


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -