“打盹“, “失眠“,“熬夜“和“睡觉“等,英语怎么说?

本文将从睡眠的程度来列出和睡眠相关的单词。

不困
not sleepy 不困
I'm wide awake/I'm not sleepy 我一点也不困
Bedtime 睡觉时间
I’m partial to a drink at bedtime.

熬夜
stay up late 熬夜,晚睡
I can't stay up late three nights in a row. (in a row 接连)
Pull an all-nighter 通常指熬夜学习或者完成某项工作
I have to pull an all-nighter to finish the report tonight.
Burn the midnight oil 开夜车,熬夜(学习)
I have an exam tomorrow so I'll be burning the midnight oil tonight.
Night owl 夜猫子
I often stay up late. I'm definitely a night owl.
lack of sleep 睡眠不足
I played the game all night, so I'm now lack of sleep.
I was up all night.

失眠
toss and turn 翻来覆去、辗转难眠
I tossed and turned all night.
insomnia 失眠症
I have insomnia
not sleep a wink 无法成眠
I had a toothache and didn't sleep a wink last night.
have a nightmare做恶梦
I had a nightmare yesterday!

就寝
get to sleep 设法睡着
I couldn't get to sleep last night.
go to bed 上床,就寝
I usually go to bed at ten.
hit the hay/sack 就寝; 上床睡觉;
have a sleep 睡觉
Usually on weekends when lots of people have a sleep in, maybe they wake up later.
I'm sleepy 我困了

打盹
doze off 打瞌睡;困倦
Some students often doze off in class.
nod off 打盹, 打瞌睡
 It's that time of day when I need to nod off, or in other words, fall asleep.
take a nap 睡午觉;小睡一下
At the same time, a lion was taking a nap in the warm sunlight.
nod off 打瞌睡
He nodded off during the lecture.

睡觉
sleep 睡觉,入睡
fall asleep 睡著
The teacher’s lectures are so dull that I fall asleep.
crash out 倒头就睡
I crashed out at a friend’s house after the party.

熟睡
sleep like a log /baby 睡得很熟、酣睡
I slept like a log yesterday.
sleep like a log 熟睡; 睡得很死; 睡得死沉;
Maria can sleep like a log in almost any place, including airplanes and cars.
oversleep 睡过头
The teacher was angry because I overslept.

睡懒觉
sleep in 睡懒觉、赖床、多睡一会儿
I’m going to sleep in.
I'll sleep in tomorrow.
lie in 睡懒觉
It's a holiday tomorrow, so you can lie in.
sleep late 睡懒觉
At weekends I like to sleep late.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是一个经典的线程同步问题,可以使用信号量来实现。 首先,我们需要定义三个信号量: - `mutex`:用于保护共享资源 TA 的状态(是否正在工作)。 - `students`:用于表示走廊上等待的学生数量。 - `chairs`:用于表示走廊上空余的座位数量。 然后,我们需要创建两个线程函数:`student` 和 `TA`。 在 `student` 函数中,每个学生会循环执行以下操作: 1. 如果走廊上有空余座位,就坐下来等待 TA 的帮助;否则离开办公室。 2. 当 TA 可用时,学生会请求 TA 的帮助。 3. 如果 TA 正在睡觉,学生会唤醒 TA。 4. 等待 TA 完成帮助。 5. 离开办公室。 在 `TA` 函数中,TA 会循环执行以下操作: 1. 如果走廊上没有学生需要帮助,就进入睡眠状态。 2. 当有学生需要帮助时,TA 会唤醒学生并进行帮助。 3. 检查走廊上是否还有学生需要帮助。 下面是一个简单的示例代码,仅供参考: ```python import threading import time mutex = threading.Semaphore(1) students = threading.Semaphore(0) chairs = threading.Semaphore(3) def student(): global chairs while True: with chairs: print(f"Student {threading.get_ident()} is waiting.") with mutex: if not ta_working: ta_working = True print(f"Student {threading.get_ident()} wakes up TA.") ta_help() ta_working = False break students.release() print(f"Student {threading.get_ident()} is waiting outside.") time.sleep(1) def ta_help(): global students while True: students.acquire() print(f"TA is helping student {threading.get_ident()}.") time.sleep(5) print(f"TA finishes helping student {threading.get_ident()}.") if not students._value: print("TA goes to sleep.") break if __name__ == "__main__": ta_working = False for i in range(5): threading.Thread(target=student).start() threading.Thread(target=ta_help).start() ``` 注意,上述代码存在一些问题,例如: - 学生和 TA 的 ID 可能会冲突。 - 学生和 TA 的工作状态需要进行同步。 - 等待学生的 `students` 信号量可能会被多次释放。 这些问题需要进一步处理和改进。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值