--- dd.c	2005-07-19 23:40:59.000000000 +0100
+++ dd.c.orig	2006-03-11 10:46:16.482267594 +0000
@@ -150,6 +150,9 @@
 static unsigned char	*ibuf;		/* input buffer pointer */
 static unsigned char	*obuf;		/* output buffer pointer */
 
+static double 		start;		/* The start time of dd */
+static unsigned long long  written;	/* The number of bytes xferred */
+
 /* This is an EBCDIC to ASCII conversion table	*/
 /* from a proposed BTL standard April 16, 1979	*/
 
@@ -472,6 +475,7 @@
 	int conv;		/* conversion option code */
 	int trunc;		/* whether output file is truncated */
 	struct stat file_stat;
+	struct timeval tv;
 
 	/* Set option defaults */
 
@@ -781,6 +785,10 @@
 		atoibm = bsd_atoibm;
 		etoa = bsd_etoa;
 	}
+
+	(void)gettimeofday(&tv, (struct timezone *)NULL);
+        start = tv.tv_sec + tv.tv_usec * 1e-6; 
+
 	/* Open the input file, or duplicate standard input */
 
 	ibf = -1;
@@ -1737,6 +1745,7 @@
 			nopr++;		/* count a partial output buffer */
 		}
 		bc = write(obf, (char *)obuf, oc);
+		written += bc;
 		if (bc != oc) {
 			if (bc < 0)
 				perror("write");
@@ -1796,10 +1805,21 @@
 static void
 stats()
 {
+	struct timeval tv;
+	double secs;
+
 	(void) fprintf(stderr, gettext("%llu+%llu records in\n"), nifr, nipr);
 	(void) fprintf(stderr, gettext("%llu+%llu records out\n"), nofr, nopr);
 	if (ntrunc) {
 		(void) fprintf(stderr,
 			gettext("%llu truncated record(s)\n"), ntrunc);
 	}
+
+	(void)gettimeofday(&tv, (struct timezone *)NULL);
+	secs = tv.tv_sec + tv.tv_usec * 1e-6 - start;
+	if (secs < 1e-6)
+		secs = 1e-6;
+	(void) fprintf(stderr, 
+		   "%llu bytes transferred in %.6f seconds (%0f bytes/sec)\n", 
+		   written, secs, written / secs);
 }

