测试 加入一段代码的效果

我的一段代码
哇,居然可以插入一段代码
  1. //this my project
  2. /**
  3.  * 2008 08 27
  4.  */
  5. public void run()
  6.     {
  7.         try
  8.         {
  9.         long startTime = System.currentTimeMillis();
  10.         long endTime = startTime;
  11.         while (i_jugThread)
  12.         {
  13.             i_step++;
  14.             startTime = System.currentTimeMillis();
  15.             this.canvas.repaint();
  16.             //this.canvas.serviceRepaints();
  17.             if (this.state == STATE_LOADING)
  18.             {
  19.                 if (!loadLock)
  20.                 {
  21.                     loadLock = true;
  22.                     Thread t = new Thread()
  23.                     {
  24.                         public void run()
  25.                         {
  26.                             // 加载耗时资源
  27.                             doLoadRes();
  28.                             //i_engine.canvas.freeBgImg();
  29.                             //state = STATE_BROWSE;
  30.                         }
  31.                     };
  32.                     t.start();
  33.                 }
  34.             }
  35.             else if (this.state == STATE_BROWSE)
  36.             {
  37.             }
  38.             
  39.             endTime = System.currentTimeMillis();
  40.             
  41.             if (endTime - startTime < INTERVAL)
  42.             {
  43. //              synchronized (this)
  44. //              {
  45. //                  try
  46. //                  {
  47. //                      this.wait(INTERVAL - (endTime - startTime));
  48. //                  }
  49. //                  catch (Exception e)
  50. //                  {
  51. //                      if (MainMidlet.DEBUG)
  52. //                          e.printStackTrace();
  53. //                  }
  54. //              }
  55.                 Thread.sleep(INTERVAL - (endTime - startTime));
  56.             }
  57.             if(i_waitJug)
  58.             {
  59.                 synchronized (this) {
  60.                     try {
  61.                         this.wait(1000);
  62.                     } catch (Exception e) {}
  63.                 }
  64.             }
  65.         }
  66.         }
  67.         catch(Exception e)
  68.         {
  69.             if(MainMidlet.DEBUG)
  70.             {
  71.                 System.out.println("engine run error.");
  72.                 e.printStackTrace();
  73.             }
  74.         }
  75.         try
  76.         {
  77.             this.canvas.initEndImg();
  78.             this.state = Engine.STATE_END;
  79.             this.canvas.repaint();
  80.             saveRMSData();
  81.             midlet.destroyApp(false);
  82.             midlet.notifyDestroyed();
  83.         }
  84.         catch (javax.microedition.midlet.MIDletStateChangeException e)
  85.         {
  86.             if (MainMidlet.DEBUG)
  87.                 e.printStackTrace();
  88.         }
  89.     }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值