java-How to delay few seconds
来源:互联网 发布:c语言输入函数 编辑:程序博客网 时间:2024/06/06 20:25
How to delay few seconds
In Java, you can use Thread.sleep(miliseconds)
to make the current executing Java program to sleep or delay few seconds.
TestSleep.java
package com.lucas.test;import java.util.Date;public class TestSleep {public static void main(String[] args) {System.out.println("Testing..." + new Date());try {//sleep 5 secondsThread.sleep(5000);System.out.println("Testing..." + new Date());} catch (InterruptedException e) {e.printStackTrace();}}}
Output
Testing...Tue Sep 22 17:26:51 SGT 2015Testing...Tue Sep 22 17:26:56 SGT 2015
0 0
- Java – How to delay few seconds
- java-How to delay few seconds
- Python – How to delay few seconds
- How to delay a method call dynamically?
- mt2523 How to delay some time
- How to get Joomla Website to Load in 1.29 Seconds
- How to add a DELAY in applying transactions in GoldenGate?
- How to Ajax auto refresh after x seconds
- From Java to Groovy in a few easy steps
- Using IP Instances with VLANs or How to Make a Few NICs Look Like Many
- How to Hook Up a VS.NET 2005 Solution With CruiseControl.NET in a Few Minutes
- How to scan whole Internet 3.7 billion IP addresses in few minutes?
- HOW TO: remove the 300ms delay when clicking on a link in JQuery Mobile
- How to Run Cron Every 5 Minutes, Seconds, Hours, Days, Months
- How to fix hung_task_timeout_secs and blocked for more than 120 seconds problem
- 60 seconds to Spring
- seconds to minutes
- java how to
- Python操作Excel读写--xlrd、xlwt模块
- ORACLE备份恢复杂谈记录
- libgdx可以添加光线变化
- leetcode problem13 Rome to Integer
- 记录下
- java-How to delay few seconds
- 一个倒计时小程序
- CocoaPods安装步骤(已有Ruby环境):
- Android实战技巧之四十二:加速度传感器
- 笔记_Maya动画中功能___摄像机___<人物主体视觉,抖动效果>003
- 如何禁止类的拷贝构造函数和复制构造函数
- PHP中上传多张图片
- 细说集中式与分布式版本控制系统
- 物联网探秘:那些来自传感器的数据都是如何上传至云端的?