measure_block_creation

Function measure_block_creation 

Source
pub fn measure_block_creation(data: &[u8]) -> Result<(u64, Block)>
Expand description

Measures the time taken to create a block from the given data.

Returns the duration in microseconds and the created block.

ยงExamples

use ipfrs_core::utils::measure_block_creation;

let (duration_us, block) = measure_block_creation(b"test data").unwrap();
assert!(duration_us > 0);