码迷,mamicode.com
首页 >  
搜索关键字:sleep    ( 4174个结果
java取得耗时时间
finallongstartTime=System.currentTimeMillis();Thread.currentThread().sleep(10000);finallongendTime=System.currentTimeMillis();finallongtime=endTime-startTime;System.out.println(time);finallongdiffSeconds=time/1000%60;finallongdiffMinutes=time/(60*1000)%60;f..
分类:编程语言   时间:2015-04-21 11:25:10    阅读次数:205
重学JAVA基础(七):线程的wait、notify、notifyAll、sleep
/** * 测试thread的wait notify notifyAll sleep Interrupted * @author tomsnail * @date 2015年4月20日 下午3:20:44 */public class Test1 { /** * 对象锁...
分类:编程语言   时间:2015-04-20 16:34:06    阅读次数:160
When you are old
When you are old——W.B Yeats (William ButlerYeats) When you are old and grey and full of sleep, And nodding by the fire, take down this book, And ...
分类:其他好文   时间:2015-04-20 14:44:08    阅读次数:101
shell脚本中生成延时
#!/bin/bashecho -n count:tput sccount=0;while true;doif [ $count -lt 40 ];then let count++; sleep 1; tput rc tput ed echo -n $count;else exi...
分类:系统相关   时间:2015-04-19 19:18:32    阅读次数:257
php 设置一个函数的最大运行时间
如何防止一个函数执行时间过长呢?在PHP里可以用pcntl时钟信号+异常来实现declare(ticks = 1);function a(){ sleep(10); echo "a finishi\n";}function b(){ echo "Stop\n";}function ...
分类:Web程序   时间:2015-04-18 17:31:02    阅读次数:121
golang 原子计数,互斥锁,耗时
import "sync"import "sync/atomic"import "time"import "runtime"1.runtime.Gosched()表示让CPU把时间片让给别人,下次某个时候继续恢复执行该goroutine,自己一般是阻塞了,这是一个很高级的sleep,我们经常会遇到要...
分类:其他好文   时间:2015-04-18 11:25:50    阅读次数:266
Sleep函数的真正用意
转自:http://blog.csdn.net/boyuejiang/article/details/8908333关于VOID Sleep(DWORD dwMilliseconds);函数,许多人都觉得,它是告诉系统,延迟多少毫秒来执行后面的代码。但是,在WINDOWS这样的非实时多任务系统中,我...
分类:其他好文   时间:2015-04-17 13:28:10    阅读次数:124
osd journal 一键迁移脚本
#!/bin/bash osd_id=$1 journal_dev=$2 if [ $# -lt 2 ] then echo "example: osd_journal_migration.sh 0 /dev/sdb1" exit 0 fi service ceph-osd stop id=$osd_id ceph-osd --flush-journal -i $osd_id sleep 2...
分类:其他好文   时间:2015-04-17 11:53:23    阅读次数:166
脚本获取网口接口速率并存入mysql
脚本如下:netflow.sh#!/bin/bash # whiletrue;do##死循环 R1=`cat/sys/class/net/eth0/statistics/rx_bytes`##获取eth0的收到流量字节数 T1=`cat/sys/class/net/eth0/statistics/tx_bytes`##获取eht0发送的流量字节数 # sleep5 R2=`cat/sys/class/net/eth0/statistics/rx_byte..
分类:数据库   时间:2015-04-15 23:34:41    阅读次数:234
Java基础--第二十四天
day24:多线程 【等待唤醒机制】 等待唤醒机制[Object] wait():让线程处于等待状态 notify():唤醒等待线程 实现或者重写父类方法,出现父类中没有的异常时,子类只能try catch。 wait():是Object类的方法,可以不用传参;释放锁对象 sleep():是Thre...
分类:编程语言   时间:2015-04-15 23:06:03    阅读次数:187
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!