output: 1100 Good 100 Bad 91.67 % Received Dumping histogram 0.00 - 0.10 seconds: 0 0.10 - 0.20 seconds: 1 0.20 - 0.30 seconds: 0 0.30 - 0.40 seconds: 0 0.40 - 0.50 seconds: 0 0.50 - 0.60 seconds: 0 0.60 - 0.70 seconds: 0 0.70 - 0.80 seconds: 0 0.80 - 0.90 seconds: 0 0.90 - 1.00 seconds: 0 1.00 - 1.10 seconds: 0 1.10 - 1.20 seconds: 0 1.20 - 1.30 seconds: 2 1.30 - 1.40 seconds: 0 1.40 - 1.50 seconds: 0 1.50 - 1.60 seconds: 1 1.60 - 1.70 seconds: 2 1.70 - 1.80 seconds: 0 1.80 - 1.90 seconds: 0 1.90 - 2.00 seconds: 0 2.00 - 2.10 seconds: 0 2.10 - 2.20 seconds: 0 2.20 - 2.30 seconds: 0 2.30 - 2.40 seconds: 0 2.40 - 2.50 seconds: 0 2.50 - 2.60 seconds: 0 2.60 - 2.70 seconds: 0 2.70 - 2.80 seconds: 0 2.80 - 2.90 seconds: 1 > than 2.90 seconds: 0 program: #include #include #include #define BUCKETS 30 #define GRANULARITY 1 #define SLEEP 100000 #define PRINTIP(data) "%hhu.%hhu.%hhu.%hhu\n", ##data[0], ##data[1], ##data[2], ##data[3] int good = 0, bad = 0, streak = 0; int histogram[BUCKETS]; void ctrlC(){ int i = 0; if (streak) { printf("Adding streak of %d\n", streak); histogram[streak/GRANULARITY > BUCKETS - 1 ? BUCKETS - 1 :streak/GRANULARITY]++; } printf("%d Good %d Bad ", good, bad); printf("%.2f %% Received\n", 100*(good/(double)(good+bad))); printf("Dumping histogram\n"); for (; i < BUCKETS-1; i++) printf("%.2f - %.2f seconds: %d\n", (i * SLEEP * GRANULARITY)/(double)1000000, ((i + 1) * SLEEP * GRANULARITY)/(double)1000000, histogram[i]); printf("> than %.2f seconds: %d\n", (i * SLEEP * GRANULARITY)/(double)1000000, histogram[i]); exit(1); } main() { struct hostent *he; signal(SIGINT, ctrlC); for(;;) { he = gethostbyname("www.google.com"); if (!he) { puts("Unable to resolve domain"); bad++; streak++; }else { if (streak) { printf("Adding streak of %d\n", streak); histogram[streak/GRANULARITY > BUCKETS - 1 ? BUCKETS - 1 :streak/GRANULARITY]++; } streak = 0; good++; printf("%s\n", inet_ntoa(*(unsigned int *)he->h_addr)); } usleep(SLEEP); } } lspci: 00:00.0 Host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02) 00:00.1 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02) 00:00.3 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02) 00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02) 00:02.1 Display controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 83) 00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 03) 00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03) 00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03) 01:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05) 01:05.0 CardBus bridge: O2 Micro, Inc. OZ711MP1/MS1 MemoryCardBus Controller (rev 21) 01:05.2 Class 0805: O2 Micro, Inc. Unknown device 7120 (rev 01) 01:05.3 Bridge: O2 Micro, Inc. Unknown device 7130 (rev 01) 01:05.4 FireWire (IEEE 1394): O2 Micro, Inc. Unknown device 00f7 (rev 02) 01:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)