From add40d4dee05b090b62d0cc9850f70eba474f7a4 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 19 Feb 2015 19:55:18 -0800 Subject: [PATCH] Fixed ford ot anchor at current main revision, not time Conflicts: n/t.c urb/zod/main/arvo/ford.hoon v/raft.c --- n/t.c | 24 ++++++++++++++++-------- v/raft.c | 14 +++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/n/t.c b/n/t.c index 381a18fe27..af4b8b8ac6 100644 --- a/n/t.c +++ b/n/t.c @@ -1,4 +1,4 @@ -/* g/t.c +/* g/t.c - ** ** This file is in the public domain. */ @@ -44,20 +44,28 @@ void u3t_slog(u3_noun hod) { #ifdef GHETTO - static int old; + + static int old; static struct timeval b4, f2, d0; c3_w ms_w; - + if ( old ) { - gettimeofday(&f2, 0); + gettimeofday(&f2, 0); timersub(&f2, &b4, &d0); ms_w = (d0.tv_sec * 1000) + (d0.tv_usec / 1000); - printf("%d.%dms ", ms_w, (int) (d0.tv_usec % 1000) / 10); + if (ms_w > 10) { + printf("%6d.%02dms ", ms_w, (int) (d0.tv_usec % 1000) / 10); + gettimeofday(&b4, 0); + } + else { + printf(" "); + } } - gettimeofday(&b4, 0); - old = 1; -#endif + else gettimeofday(&b4, 0); + old = 1; + +#endif if ( c3y == u3du(hod) ) { u3_noun pri = u3h(hod); diff --git a/v/raft.c b/v/raft.c index f60932b410..000f81193f 100644 --- a/v/raft.c +++ b/v/raft.c @@ -1575,20 +1575,16 @@ _raft_punk(u3_noun ovo) #ifdef GHETTO c3_w ms_w; + c3_w clr_w; gettimeofday(&f2, 0); timersub(&f2, &b4, &d0); ms_w = (d0.tv_sec * 1000) + (d0.tv_usec / 1000); - if(c3__belt != u3h(u3t(ovo))){ - uL(fprintf(uH, "punk %s %d.%dms\x1b[0m\n", - txt_c, ms_w, (int) (d0.tv_usec % 1000) / 10)); + clr_w = ms_w > 1000 ? 1 : ms_w < 100 ? 2 : 3; // red, green, yellow + if(!(c3__belt == u3h(u3t(ovo)) && clr_w == 2)){ + uL(fprintf(uH, "\x1b[3%dm%%punk %s %4d.%02dms\x1b[0m\n", + clr_w, txt_c, ms_w, (int) (d0.tv_usec % 1000) / 10)); } - - // clr_w = ms_w > 1000 ? 1 : ms_w < 100 ? 2 : 3; // red, green, yellow - // if(c3__belt != u3h(u3t(ovo)) || clr_w != 2){ - // uL(fprintf(uH, "\x1b[3%dm%%punk %s %d.%dms\x1b[0m\n", - // clr_w, txt_c, ms_w, (int) (d0.tv_usec % 1000) / 10)); - // } free(txt_c); #endif