Move rate limit example to test/
This commit is contained in:
@@ -58,24 +58,3 @@ int uc_ratelimit_allow(struct RateLimit *r, long current_ts)
|
||||
return allowed;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
struct RateLimit r;
|
||||
time_t start;
|
||||
|
||||
uc_ratelimit_init(&r, 10, 60, time(NULL));
|
||||
|
||||
for(i = 0; i < 120; i++) {
|
||||
int k;
|
||||
long allowed = 0;
|
||||
sleep(1);
|
||||
for (k = 0; k < 500; k++)
|
||||
allowed += uc_ratelimit_allow(&r, time(NULL));
|
||||
printf("%ld of 500 can pass\n", allowed);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user