/** * 基础线程对象. * * @author jevan * @version (1.0 at 2013-6-17) * @version (1.1 at 2013-7-2) 增加onDestory接口{@link #onDestory()},增加stop方法{@link #stop() }. */ public abstract class BaseThread implements Runnable { public static final int SUSPEND_
Pausing Execution with Sleep Thread.sleep causes the current thread to suspend execution for a specified period. This is an efficient means of making processor time available to the other threads of an application or other applications that might be
Runnable创建线程 public class RunnableDemo implements Runnable{ @Override public void run(){ int i = 1; while(true) { System.out.println(Thread.currentThread().getName()+"线程名字"+i); i++; if(i>30){ break; } try{ Thread.currentThread().sleep(3000);
using System; using System.Text; using System.Windows.Forms; using System.Threading; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e)