From d53fa3ea8464cc6a2557b3ca877493ce98aa7c5b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:18:54 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c96c27f22..0f4722c58 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -303,7 +303,6 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int int32_t LP_nanomsg_recvs(void *ctx) { - static double lastmilli; int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli; if ( (origipaddr= LP_myipaddr) == 0 ) origipaddr = "127.0.0.1"; @@ -323,9 +322,8 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( lastmilli > 0. && milli > lastmilli+100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); - lastmilli = milli; + if ( OS_milliseconds()-milli > 100 ) + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { @@ -338,9 +336,8 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( lastmilli > 0. && milli > lastmilli+100 ) - fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:""); - lastmilli = milli; + if ( OS_milliseconds()-milli > 100 ) + fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } //portable_mutex_unlock(&LP_nanorecvsmutex); return(nonz);