如何在汇编中获取以毫秒为单位的时间?
我能够以秒为单位获取它,但是如何获取毫秒值? 我正在尝试使用 gettimeofday 系统调用:
sys_gettimeofday_ms:
enter $0, $0
pushq $0
pushq $2
leaq -16(%rbp), %rdi
mov $96, %rax
syscall
movq -16(%rbp), %rax
leave
ret
I was able to get it in seconds, but how to get the value of milliseconds?
I am trying with the gettimeofday system call:
sys_gettimeofday_ms:
enter $0, $0
pushq $0
pushq $2
leaq -16(%rbp), %rdi
mov $96, %rax
syscall
movq -16(%rbp), %rax
leave
ret
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能有效(未经测试),针对 x86_64 Linux。
This might work (untested), targeting x86_64 Linux.