add time helper function
This commit is contained in:
parent
11028d7aae
commit
0b4e9bdab7
@ -36,6 +36,10 @@ pub const _TARGET_MIPS_PER_MHZ : f32 = QEMU_ISNS_PER_SEC as f32 / _TARGET_SYSCLK
|
||||
pub const _TARGET_SYSCLK_PER_QEMU_SEC : u32 = (_TARGET_SYSCLK_FREQ as f32 * _TARGET_MIPS_PER_MHZ) as u32;
|
||||
pub const _QEMU_SYSCLK_PER_TARGET_SEC : u32 = (_TARGET_SYSCLK_FREQ as f32 * _TARGET_MHZ_PER_MIPS) as u32;
|
||||
|
||||
pub fn tick_to_time(ticks: u64) -> Duration {
|
||||
Duration::from_nanos((ticks << QEMU_ICOUNT_SHIFT) as u64)
|
||||
}
|
||||
|
||||
//========== Metadata
|
||||
#[derive(Debug, SerdeAny, Serialize, Deserialize)]
|
||||
pub struct QemuIcountMetadata {
|
||||
|
Loading…
x
Reference in New Issue
Block a user