Aiting's Blog-艾丁堡

生活*爱情*随想*感知

import java.util.*;

class repeat
{
    public static void main(String[] args)
    {
        Calendar ins = Calendar.getInstance();
        int firstMinute = ins.get(Calendar.MINUTE);
        int firstSecond = ins.get(Calendar.SECOND);
        int lastMinute = firstMinute + 1;

        int count = 1;

        while (count<1000000)
        {
            System.out.println("This is aiting in the house!\n");
            Calendar now = Calendar.getInstance();
            if (lastMinute == now.get(Calendar.MINUTE))
            {
                if (firstSecond == now.get(Calendar.SECOND))
                {
                    break;
                }
            }
            count++;
        }
        
        System.out.println("It has run "+ count +" times");
    }
}

我的电脑执行了99622次,看看你的电脑比我的爱机快否?


Trackback: http://tb.donews.net/TrackBack.aspx?PostId=266208


[点击此处收藏本文]  发表于2005年02月02日 7:42 PM




正在读取评论……

发表评论

大名:
网址:
验证码
评论 
   

news

把生活淡化,

淡到心领神会,

淡到百折不挠。

访问:

导航

blog stats

文章

收藏

相册

CAU

JAVA

网页设计

新闻

信息

友情链接

存档


正在读取评论……