Fixed ford ot anchor at current main revision, not time

This commit is contained in:
Anton Dyudin 2015-02-19 19:55:18 -08:00
parent 3c96f935f7
commit 37cbb041c9
2 changed files with 24 additions and 1 deletions

20
n/t.c
View File

@ -42,6 +42,26 @@ u3_lo_tank(c3_l tab_l, u3_noun tac);
void
u3t_slog(u3_noun hod)
{
#ifdef GHETTO
static int old;
static struct timeval b4, f2, d0;
c3_w ms_w;
if ( old ) {
gettimeofday(&f2, 0);
timersub(&f2, &b4, &d0);
ms_w = (d0.tv_sec * 1000) + (d0.tv_usec / 1000);
if(ms_w > 10){
printf("%3d.%dms ", ms_w, (d0.tv_usec % 1000) / 10);
gettimeofday(&b4, 0);
}
}
else gettimeofday(&b4, 0);
old = 1;
#endif
if ( c3y == u3du(hod) ) {
u3_noun pri = u3h(hod);

View File

@ -1573,11 +1573,14 @@ _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);
uL(fprintf(uH, "%%punk %s %d.%dms\n", txt_c, ms_w, (d0.tv_usec % 1000) / 10));
clr_w = ms_w > 1000 ? 1 : ms_w < 100 ? 2 : 3; // red, green, yellow
uL(fprintf(uH, "\x1b[3%dm%%punk %s %d.%dms\x1b[0m\n",
clr_w, txt_c, ms_w, (d0.tv_usec % 1000) / 10));
free(txt_c);
#endif