*** ./doc/src/sgml/ref/psql-ref.sgml.orig	Thu Jan  3 17:46:31 2002
--- ./doc/src/sgml/ref/psql-ref.sgml	Thu Jan  3 17:50:49 2002
***************
*** 1120,1125 ****
--- 1120,1135 ----
  
  
        <varlistentry>
+         <term><literal>\timing</literal>
+         <listitem>
+         <para>
+         Toggles a display of how long each query takes in seconds.
+         </para>
+         </listitem>
+       </varlistentry>
+ 
+ 
+       <varlistentry>
          <term><literal>\w</literal> {<replaceable class="parameter">filename</replaceable> | <replaceable class="parameter">|command</replaceable>}</term>
          <listitem>
          <para>
*** ./src/bin/psql/command.c.orig	Thu Jan  3 16:34:36 2002
--- ./src/bin/psql/command.c	Thu Jan  3 16:40:09 2002
***************
*** 702,709 ****
  
  	/* \timing -- toggle timing of queries */
  	else if (strcmp(cmd, "timing") == 0)
! 	  {
! 		success = do_pset("timing", NULL, &pset.popt, quiet);
  
  	/* \unset */
  	else if (strcmp(cmd, "unset") == 0)
--- 702,722 ----
  
  	/* \timing -- toggle timing of queries */
  	else if (strcmp(cmd, "timing") == 0)
! 	{
! 		pset.timing = !pset.timing;
! 		if (!quiet)
! 		{
! 			if (pset.timing)
! 			{
! 				puts(gettext(("Timing is on.")));
! 			}
! 			else
! 			{
! 				puts(gettext(("Timing is off.")));
! 
! 			}
! 		}
! 	}
  
  	/* \unset */
  	else if (strcmp(cmd, "unset") == 0)
*** ./src/bin/psql/common.c.orig	Thu Jan  3 16:51:05 2002
--- ./src/bin/psql/common.c	Thu Jan  3 17:35:00 2002
***************
*** 577,583 ****
  /* Possible timing output */
  		if (pset.timing && success)
  		{
! 			printf(gettext("Total time: %.4fs\n"), ((after.tv_sec-before.tv_sec)*1000000 + after.tv_usec - before.tv_usec) / 1000000.0);
  		}
  	}
  
--- 577,583 ----
  /* Possible timing output */
  		if (pset.timing && success)
  		{
! 			printf(gettext("Total time: %.3fs\n"), ((after.tv_sec-before.tv_sec)*1000000 + after.tv_usec - before.tv_usec) / 1000000.0);
  		}
  	}
  
*** ./src/bin/psql/help.c.orig	Thu Oct 25 01:49:54 2001
--- ./src/bin/psql/help.c	Thu Jan  3 17:37:07 2002
***************
*** 229,234 ****
--- 229,236 ----
  	fprintf(fout, _(" \\t             show only rows (currently %s)\n"),
  			ON(pset.popt.topt.tuples_only));
  	fprintf(fout, _(" \\T TEXT        set HTML table tag attributes\n"));
+ 	fprintf(fout, _(" \\timing        toggle timing of queries (currently %s)\n"),
+ 			ON(pset.timing));
  	fprintf(fout, _(" \\unset NAME    unset (delete) internal variable\n"));
  	fprintf(fout, _(" \\w FILENAME    write current query buffer to file\n"));
  	fprintf(fout, _(" \\x             toggle expanded output (currently %s)\n"),
*** ./src/bin/psql/settings.h.orig	Sun Oct 28 01:25:58 2001
--- ./src/bin/psql/settings.h	Thu Jan  3 16:19:03 2002
***************
*** 50,55 ****
--- 50,56 ----
  
  	bool		issuper;		/* is the current user a superuser? (used
  								 * to form the prompt) */
+ 	bool		timing;			/* timing of all queries */
  } PsqlSettings;
  
  extern PsqlSettings pset;
*** ./src/bin/psql/tab-complete.c.orig	Mon Nov  5 12:46:31 2001
--- ./src/bin/psql/tab-complete.c	Thu Jan  3 17:43:34 2002
***************
*** 275,282 ****
  		"\\e", "\\echo",
  		"\\encoding", "\\g", "\\h", "\\i", "\\l",
  		"\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",
! 		"\\o", "\\p", "\\pset", "\\q", "\\qecho", "\\r", "\\set", "\\t", "\\unset",
! 		"\\x", "\\w", "\\z", "\\!", NULL
  	};
  
  	(void) end;					/* not used */
--- 275,282 ----
  		"\\e", "\\echo",
  		"\\encoding", "\\g", "\\h", "\\i", "\\l",
  		"\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",
! 		"\\o", "\\p", "\\pset", "\\q", "\\qecho", "\\r", "\\set", "\\t",
! 		"\\timing", "\\unset", "\\x", "\\w", "\\z", "\\!", NULL
  	};
  
  	(void) end;					/* not used */
