MCPcopy Index your code
hub / github.com/python/cpython / spin

Method spin

Lib/profiling/sampling/gecko_collector.py:669–677  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

667 stop_spinner = threading.Event()
668
669 def spin():
670 message = 'Building Gecko profile...'
671 while not stop_spinner.is_set():
672 sys.stderr.write(f'\r{next(spinner)} {message}')
673 sys.stderr.flush()
674 time.sleep(0.1)
675 # Clear the spinner line
676 sys.stderr.write('\r' + ' ' * (len(message) + 3) + '\r')
677 sys.stderr.flush()
678
679 spinner_thread = threading.Thread(target=spin, daemon=True)
680 spinner_thread.start()

Callers

nothing calls this directly

Calls 4

is_setMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected