就是租两次一共给10000 mile的offer。我的基本到账了,这样租车算是free了 所以还是有用的 注意必须用email link hertz acct 里加上mikeageplus
q*c
3 楼
类似于rate limiter吗?试了下: boolean allowRequest() { int minInterval = 1000/N; // N is the max rate
int current = now(); int diff = current-last; last = current; //last would be a class private member if(diff < minInterval) return false; else return true; }
9/26 Subject: By invitation only: Earn up to 10,500 miles on just two car rentals
【在 l*l 的大作中提到】 : 谢谢! 啥时候发的email?
l*8
7 楼
每秒钟十次,不等于每100毫秒一次吧?
【在 q********c 的大作中提到】 : 类似于rate limiter吗?试了下: : boolean allowRequest() { : int minInterval = 1000/N; // N is the max rate : : int current = now(); : int diff = current-last; : last = current; //last would be a class private member : if(diff < minInterval) : return false; : else
l*l
8 楼
谢谢老余!
rentals
【在 y****i 的大作中提到】 : 9/26 : Subject: By invitation only: Earn up to 10,500 miles on just two car rentals
【在 q********c 的大作中提到】 : 类似于rate limiter吗?试了下: : boolean allowRequest() { : int minInterval = 1000/N; // N is the max rate : : int current = now(); : int diff = current-last; : last = current; //last would be a class private member : if(diff < minInterval) : return false; : else
class QueryLimiter{ private long started = 0; private int count = 0; private int maxRate ; public QueryLimiter(int m){ maxRate = m; } public boolean allowRequest(){ long now = SomeAPI.now(); if(now - started > 1000 //1sec ){ started = now; count = 0; } return count} public void query(Object param){ count++; //. ...query/email,whatever... } } assuming this class is used in single thread scenario, and called like this: QueryLimiter ql = new QueryLimiter(1000); if(ql.allowRequest()){ ql.query(...); }