search for: print_cp_result

Displaying 2 results from an estimated 2 matches for "print_cp_result".

2010 Mar 18
0
[MODULE] COM32 module to time null-dumping a file
...#39;s optimal? Under 4k? + * layout.inc: xfer_buf_seg equ 1000h + */ + +float get_tps(){ return 18.2; } + +#else /* __COM32__ */ + +#define BUFSZ 16384 +/* Need to check what might be a "best" buffer/fetch block size here */ + +float get_tps(){ return (float)sysconf(_SC_CLK_TCK); } +void print_cp_result2(char *fn, int bcnt, clock_t bc, clock_t ec) +{ + float et, dr; + et = ((float)(ec - bc)) / (float)sysconf(_SC_CLK_TCK); + dr = ((float)bcnt) / et; + printf(" %dB in %.3fs from '%s'\n", bcnt, et, fn); + printf(" %.0f B/s; %.0f KiB/s; %.0f MiB/s\n", dr, dr/1024, dr/1048...
2010 Mar 20
1
[MODULE] COM32 module to time null-dumping a file, v1.1
...*/ + +#ifndef SSIZE_MAX +# define SSIZE_MAX PTRDIFF_MAX +#endif +/* typedef ptrdiff_t ssize_t; */ +#define BUFSZ_MAX SSIZE_MAX +/* ssize_t max */ +#define BUFSZ_MIN 1 +#ifndef OFF_MAX +# define OFF_MAX SIZE_MAX +#endif +/* typedef size_t off_t */ +#define LEN_MAX OFF_MAX +/* off_t max */ + +void print_cp_result_tick(int bcnt, clock_t et, float tps, int offs) +{ + int dr; + dr = bcnt * tps / max(1,(et + offs)); // prevent divide by 0 + printf(" %+d %d B/s; %d KiB/s; %d MiB/s\n", offs, dr, dr/1024, dr/1048576); +} /* void print_cp_result_tick(int bcnt, clock_t et, float tps, int offs) */ + +void...