diff -rauN ascpu-1.9.orig/ascpu.c ascpu-1.9_korseby/ascpu.c --- ascpu-1.9.orig/ascpu.c 2000-03-09 21:10:25.000000000 +0100 +++ ascpu-1.9_korseby/ascpu.c 2004-09-11 15:46:07.000000000 +0200 @@ -67,13 +67,13 @@ safecopy(window_name, "ascpu", 50); safecopy(display_name, "", 50); safecopy(mainGeometry, "", 50); - safecopy(state.bgcolor, "#303030", 50); - safecopy(state.fgcolor, "#20b2aa", 50); + safecopy(state.bgcolor, "#2e334e", 50); + safecopy(state.fgcolor, "#b8ccfd", 50); - safecopy(sys_color, "", 50); - safecopy(nice_color, "", 50); - safecopy(user_color, "", 50); - safecopy(idle_color, "", 50); + safecopy(sys_color, "#b8ccfd", 50); + safecopy(nice_color, "#5e6881", 50); + safecopy(user_color, "#8492b5", 50); + safecopy(idle_color, "#2e334e", 50); } /* print the usage for the tool */ @@ -83,7 +83,7 @@ printf("-V print version and exit\n"); printf("-h -H -help print this message\n"); printf("-title set the window/icon title to this name\n"); - printf("-u the update interval in seconds\n"); + printf("-u the update interval in microseconds\n"); printf("-cpu the CPU number to show\n"); printf("-samples the number of samples in the average\n"); printf("-history the number of samples for the running history\n"); diff -rauN ascpu-1.9.orig/ascpu_x.c ascpu-1.9_korseby/ascpu_x.c --- ascpu-1.9.orig/ascpu_x.c 2000-03-09 22:50:37.000000000 +0100 +++ ascpu-1.9_korseby/ascpu_x.c 2004-09-11 15:46:07.000000000 +0200 @@ -75,7 +75,9 @@ Pixel pix[4]; /* last time we updated */ -time_t last_time = 0; +// time_t last_time = 0; +int last_time = 0; +int actual_time = 0; /* requests for update */ int update_request = 0; @@ -711,15 +713,28 @@ void ascpu_update() { - time_t cur_time; - cur_time = time(0); - if ( abs(cur_time - last_time) >= state.update_interval ) { - last_time = cur_time; + struct timeval tv; + int cur_time; + + gettimeofday(&tv, NULL); + cur_time = (int) tv.tv_usec / 1000; + + if ( last_time > cur_time ) + last_time = (-1) * (1000 - last_time); + + actual_time += abs(cur_time - last_time); +// printf("abs(%i-%i)=%i += %i >= %i\n", cur_time, last_time, abs(cur_time - last_time), actual_time, state.update_interval); + last_time = cur_time; + + if ( actual_time >= state.update_interval ) { + actual_time = 0; read_stat(); update_running(); update_average(); } + CheckX11Events(); + if ( update_request ) { ascpu_redraw(); }