__end is reserved in g++4.8.x's header

This commit is contained in:
zhengshuxin 2017-08-09 11:41:47 +08:00
parent c54aef5ba1
commit 1cc6196861

View File

@ -4,7 +4,8 @@
static int __fibers_count = 2;
static int __fibers_max = 2;
static int __oper_count = 100;
static struct timeval __begin, __end;
static struct timeval __begin;
static struct timeval __finish;
static void fiber_redis(ACL_FIBER *fiber, void *ctx)
{
@ -75,8 +76,8 @@ static void fiber_redis(ACL_FIBER *fiber, void *ctx)
if (--__fibers_count == 0) {
long long total = __fibers_max * i * 3;
gettimeofday(&__end, NULL);
spent = stamp_sub(&__end, &__begin);
gettimeofday(&__finish, NULL);
spent = stamp_sub(&__finish, &__begin);
printf("fibers: %d, count: %lld, spent: %.2f, speed: %.2f\r\n",
__fibers_max, total, spent,
(total * 1000) / (spent > 0 ? spent : 1));