mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
rust/timer: Define NANOSECONDS_PER_SECOND binding as u64
NANOSECONDS_PER_SECOND is often used in operations with get_ns(), which currently returns a u64. Therefore, define a new NANOSECONDS_PER_SECOND binding is with u64 type to eliminate unnecessary type conversions (from u32 to u64). Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250414144943.1112885-6-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
cff1ec6750
commit
8d9502b4e9
1 changed files with 2 additions and 0 deletions
|
@ -121,3 +121,5 @@ impl ClockType {
|
|||
pub const CLOCK_VIRTUAL: ClockType = ClockType {
|
||||
id: QEMUClockType::QEMU_CLOCK_VIRTUAL,
|
||||
};
|
||||
|
||||
pub const NANOSECONDS_PER_SECOND: u64 = 1000000000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue