fusion/common/utils/ratelimit.c

30 lines
902 B
C
Raw Normal View History

2025-08-05 07:53:44 +00:00
/**********************************************************************************************
File name : ratelimit.h
Module : common
Author :
Copyright :
Version : 0.1
Created on : 2021-11-18
Creator : amir.liang
Description :
ratelimit(func()); call这个调用5func()
Modify History:
1. Date: Author: Modification:
************************************************************************************************/
#include "ratelimit.h"
static void retalimit_delay(){
hv_msleep(500);
}
void retalimit_test()
{
uint64_t start = gettimeofday_ms();
LOG_TIME(retalimit_delay());
while(gettimeofday_ms() - start < 1000){
ratelimit(printf("%s test\n", __func__));
}
LOG_TIME("retalimit_delay()");
}