diff --git a/examples/file/readspeed.c b/examples/file/readspeed.c index a41c12655..d83fdcb20 100644 --- a/examples/file/readspeed.c +++ b/examples/file/readspeed.c @@ -55,7 +55,7 @@ void readspeed(const char* filename, int block_size) rt_free(buff_ptr); /* calculate read speed */ - rt_kprintf("File read speed: %d byte/s\n", total_length*RT_TICK_PER_SECOND/tick); + rt_kprintf("File read speed: %d byte/s\n", total_length /tick * RT_TICK_PER_SECOND); } #ifdef RT_USING_FINSH diff --git a/examples/file/writespeed.c b/examples/file/writespeed.c index 157b24f47..5fa2f4445 100644 --- a/examples/file/writespeed.c +++ b/examples/file/writespeed.c @@ -63,7 +63,7 @@ void writespeed(const char* filename, int total_length, int block_size) rt_free(buff_ptr); /* calculate write speed */ - rt_kprintf("File write speed: %d byte/s\n", total_length*RT_TICK_PER_SECOND/tick); + rt_kprintf("File write speed: %d byte/s\n", total_length / tick * RT_TICK_PER_SECOND); } #ifdef RT_USING_FINSH