测量 Linux 系统调用消耗的时间

测量 Linux 系统调用消耗的时间

测量 Linux 系统调用消耗的时间


源代码仓库:https://gitcode.com/opensourceworld/sys_call_cost

In this homework, you’ll measure the costs of a system call. Measuring the cost of a system call is relatively easy. For example, you could repeatedly call a simple system call(e.g., performing a 0-byte read), and time how long it takes; dividing the time bgy the number of iterations gives you an
estimate of the cost of a system call.

根据 gettimeofday 的手册,这个函数已经过时 了,应该使用 clock_gettime 函数。看了一下文档,发现 clock_gettime 使用 CLOCK_REALTIME 时,和 gettimeofday 相同,都是计算相对于 Epoch 的时间。也要看看其它类型的 CLOCK。

2025年4月29日星期二 23:01

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dowhileprogramming

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值