java中的sleep是什么意思

java中的sleep是什么意思,第1张

SLEEP,英语单词,名词、动词,作名词时意为“睡眠,型银人名;(英)斯利普”,作动词时意为“睡,睡觉”。

单词发音英[sli_p]美[sli_p]基本用法sleep用作动词的基本意思是“睡眠”,也可作“启则为(某数量的人)提供床位”解。

sleep与介词to连用时一般都省略冠词。sleep用作名词的意思卜旁宴是“睡眠”,是不可数名词加不定冠词时,表示“一段时间的睡眠”。

sleep的进行时可以表示按计划、安排或打算即将发生的动作,这时句中往往有表示将来的时间状语或特定的上下文。一站式出国留学攻略 http://www.offercoming.com

sleep和wait的区别:

1、sleep的意思是:睡,睡觉,睡眠。

2、wait的意思是:等候,推迟,延缓等待,耽搁,伺则碧候用餐。

拓展资料

sleep的用法

1、They were exhausted from lack of sleep

由于缺乏睡眠,他们非常疲惫。

2、扮盯启During the car journey, the baby slept

坐车来的路上,宝宝睡着了。

3、I think he may be ready for a sleep soon.

我想他也许很快就要睡一觉了。

4、I can't get to sleep with all that singing.

那些歌声搅得我无法入睡厅如。

5、I didn't lose too much sleep over that investigation.

我并不太担心那个调查。

wait

1、I walk to a street corner and wait for the school bus

我走到街角等校车。

2、There'll be a car waiting for you

会有辆汽车等你。

3、I want to talk to you, but it can wait

我想和你谈谈,但可以晚点再说。

4、If you think this all sounds very exciting, just wait until you read the book

如果你觉得所有这些听起来令人兴奋,那就等着去读这本书吧。

5、'Wait a minute!' he broke in. 'This is not giving her a fair hearing!'

“等一下,”他插嘴说,“这没有给她一个公平的解释机会!”

1、同步锁的对待不同:

sleep()后,程序巧如并不会不释放同步锁。

wait()后,程序会释放同步锁。

2、用法的不同:

sleep()可以用时间指定来使他自动醒过来。如果时间不到你只能调用interreput()来强行打断。

wait()可以用notify()直接唤起。

3、属于不哗宽纯同乱咐的类:

sleep()的类是Thread。

wait()的类是Object。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/12310050.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-22
下一篇2023-05-22

发表评论

登录后才能评论

评论列表(0条)

    保存