mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-14 18:38:55 +00:00
28 lines
572 B
C
28 lines
572 B
C
/*
|
|
* Copyright (c) 2024, ArtInChip Technology Co., Ltd
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Authors: Wu Dehuang <dehuang.wu@artinchip.com>
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <aic_utils.h>
|
|
#include <aic_common.h>
|
|
|
|
void show_speed(char *msg, unsigned long len, unsigned long us)
|
|
{
|
|
unsigned long tmp, speed;
|
|
|
|
/* Split to serval step to avoid overflow */
|
|
tmp = 1000 * len;
|
|
tmp = tmp / us;
|
|
tmp = 1000 * tmp;
|
|
speed = tmp / 1024;
|
|
|
|
printf("%s: %ld byte, %ld us -> %ld KB/s\n", msg, len, us, speed);
|
|
}
|
|
|