[Zope3-checkins] CVS: Zope3 - z3.py:1.18

Guido van Rossum guido@python.org
Tue, 22 Apr 2003 08:08:15 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv17925

Modified Files:
	z3.py 
Log Message:
Add a log message indicating the total startup time.


=== Zope3/z3.py 1.17 => 1.18 ===
--- Zope3/z3.py:1.17	Thu Mar  6 13:25:13 2003
+++ Zope3/z3.py	Tue Apr 22 08:08:13 2003
@@ -17,11 +17,15 @@
 $Id$
 """
 
-import os, sys
+import os, sys, time
 
 basepath = filter(None, sys.path)
 
 def run(argv=sys.argv):
+    # Record start times (real time and CPU time)
+    t0 = time.time()
+    c0 = time.clock()
+
     # Refuse to run without principals.zcml
     if not os.path.exists('principals.zcml'):
         print """ERROR: You need to create principals.zcml
@@ -77,6 +81,12 @@
     XMLConfig(os.path.join(dir, 'zserver.zcml'))()
 
     from zodb.zeo import threadedasync
+
+    # Report total startup time
+    t1 = time.time()
+    c1 = time.clock()
+    logging.info("Startup time: %.3f sec real, %.3f sec CPU", t1-t0, c1-c0)
+
     try:
         threadedasync.loop()
     except KeyboardInterrupt: