MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / __exit__

Method __exit__

tools/toolchain_profiler.py:40–53  ·  view source on GitHub ↗
(self, exc_type, value, traceback)

Source from the content-addressed store, hash-verified

38 self.start = time.time()
39
40 def __exit__(self, exc_type, value, traceback):
41 # When a block ends debug log the total duration.
42 now = time.time()
43 duration = now - self.start
44 if exc_type:
45 msg = 'block "%s" raised an exception after %.3f seconds'
46 else:
47 msg = 'block "%s" took %.3f seconds'
48 if EMPROFILE == 2:
49 Logger.depth -= 1
50 indentation = ' ' * Logger.depth
51 logger.info(indentation + msg, self.name, duration)
52 else:
53 logger.debug(msg, self.name, duration)
54
55
56if EMPROFILE == 1:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected