python:timeit

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:timeit [2020/09/11 17:03] ともやんpython:timeit [2021/07/05 02:38] (現在) ともやん
行 2: 行 2:
 timeit モジュールは処理の実行時間を計測する。\\ timeit モジュールは処理の実行時間を計測する。\\
  
-<WRAP prewrap 100% #mincode>+<WRAP prewrap 100% mincode>
 <code python dir_walk.py> <code python dir_walk.py>
 #!/usr/bin/env python3 #!/usr/bin/env python3
行 52: 行 52:
 timeit.template を変更して、処理時間と戻り値を返却するようする。\\ timeit.template を変更して、処理時間と戻り値を返却するようする。\\
 **timeit.template (オリジナル)**\\ **timeit.template (オリジナル)**\\
-<WRAP prewrap 100% #mincode>+<WRAP prewrap 100% mincode>
 <code python> <code python>
 template = """ template = """
行 68: 行 68:
 **timeit.template (モンキーパッチ)**\\ **timeit.template (モンキーパッチ)**\\
 <html><span style="color: red; font-weight: bold;">モンキーパッチの際にインデントを崩してはならない!</span></html>\\ <html><span style="color: red; font-weight: bold;">モンキーパッチの際にインデントを崩してはならない!</span></html>\\
-<WRAP prewrap 100% #mincode>+<WRAP prewrap 100% mincode>
 <code python> <code python>
 timeit.template = """ timeit.template = """
行 83: 行 83:
  
 ===== timeit.timeit() の実装 ===== ===== timeit.timeit() の実装 =====
-<WRAP prewrap 100% #mincode>+<WRAP prewrap 100% mincode>
 <code python> <code python>
 # Don't change the indentation of the template; the reindent() calls # Don't change the indentation of the template; the reindent() calls
行 100: 行 100:
 </WRAP> </WRAP>
  
-<WRAP prewrap 100% #mincode_long>+<WRAP prewrap 100% mincode_long>
 <code python> <code python>
 class Timer: class Timer:
行 158: 行 158:
 </WRAP> </WRAP>
  
-<WRAP prewrap 100% #mincode>+<WRAP prewrap 100% mincode>
 <code python> <code python>
 def timeit(stmt="pass", setup="pass", timer=default_timer, def timeit(stmt="pass", setup="pass", timer=default_timer,
行 167: 行 167:
 </WRAP> </WRAP>
  
-<WRAP prewrap 100% #mincode_long>+<WRAP prewrap 100% mincode_long>
 <code python Python38/Lib/timeit.py> <code python Python38/Lib/timeit.py>
 #! /usr/bin/env python3 #! /usr/bin/env python3
  • python/timeit.1599811423.txt.gz
  • 最終更新: 2020/09/11 17:03
  • by ともやん