问题中给出的结果完全是由于噪声造成的,没有任何有用的信息。代码编译下来的内容是
movq std::time::Instant::now@GOTPCREL(%rip), %r14
callq *%r14 // First call to `Instant::now()`
movq %rax, %rbx
// `use_filter` went away entirely, as one would expect
movl %edx, %ebp
callq *%r14 // Second call to `Instand::now()`
movq %rax, %rdi
movl %edx, %esi
movq %rbx, %rdx
movl %ebp, %ecx
callq *<std::time::Instant as core::ops::arith::Sub>::sub@GOTPCREL(%rip)
// [...] print result
callq *%r14 // Third call to `Instant::now()`
movq %rax, %rbx
// `use_retention` went away entirely
movl %edx, %ebp
callq *%r14 // Third call to `Instant::now()`
movq %rax, %rdi
movl %edx, %esi
movq %rbx, %rdx
movl %ebp, %ecx
callq *<std::time::Instant as core::ops::arith::Sub>::sub@GOTPCREL(%rip)
// [...] print result
也就是说,你的时差
测量
是向发出这两个电话所花费的时间吗
Instant::now()
,与
没有什么
在两者之间。没有区别。你的时差
看到
是由于实施过程中的不准确造成的
Instant::now()
、线程调度或一般噪声。