Code block timing in Python