fix speed calculate bug

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1231 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
wuyangyong 2011-01-02 16:39:23 +00:00
parent 6389520f5e
commit 74bb729462
2 changed files with 4 additions and 4 deletions

View File

@ -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/ (tick/RT_TICK_PER_SECOND));
rt_kprintf("File read speed: %d byte/s\n", total_length*RT_TICK_PER_SECOND/tick);
}
#ifdef RT_USING_FINSH

View File

@ -20,7 +20,7 @@ void writespeed(const char* filename, int total_length, int block_size)
char *buff_ptr;
rt_tick_t tick;
fd = open(filename, O_WRONLY | O_WRONLY | O_TRUNC, 0);
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0);
if (fd < 0)
{
rt_kprintf("open file:%s failed\n", filename);
@ -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/ (tick/RT_TICK_PER_SECOND));
rt_kprintf("File write speed: %d byte/s\n", total_length*RT_TICK_PER_SECOND/tick);
}
#ifdef RT_USING_FINSH