Permalink
Browse files

Add PID to the OIL_TIMING trace.

Also get rid of unused 'libc' import.  Thinking about PyPy.
  • Loading branch information...
Andy Chu
Andy Chu committed Oct 5, 2017
1 parent a239109 commit ce06499324b06a74ddf5b55787d3f802ee3e3385
Showing with 4 additions and 3 deletions.
  1. +4 −1 bin/oil.py
  2. +0 −2 core/word_eval.py
View
@@ -28,7 +28,8 @@
# Uncomment this to see startup time problems.
if os.environ.get('OIL_TIMING'):
def tlog(msg):
print('%.3f' % ((time.time() - start_time) * 1000), msg)
pid = os.getpid() # TODO: Maybe remove PID later.
print('[%d] %.3f %s' % (pid, (time.time() - start_time) * 1000, msg))
else:
def tlog(msg):
pass
@@ -450,6 +451,8 @@ def main(argv):
except RuntimeError as e:
print('FATAL: %s' % e, file=sys.stderr)
sys.exit(1)
finally:
tlog('Exiting main()')
if __name__ == '__main__':
View
@@ -6,8 +6,6 @@
import re
import sys
import libc
from core import braces
from core import expr_eval
from core import glob_

0 comments on commit ce06499

Please sign in to comment.