python:timeit

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:timeit [2020/03/27 10:08] – [timeit モンキーパッチ] ともやんpython:timeit [2021/07/05 02:38] (現在) ともやん
行 1: 行 1:
-<html> 
-  <style> 
-    #mincode pre { 
-      /*height: 300px;*/ 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-    #mincode_long pre { 
-      height: 400px; 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-    #mintbl table { 
-      font-size: 12px; 
-    } 
-    .dokuwiki .plugin_wrap table { 
-      width: auto; 
-    } 
-    #result pre { 
-      /*height: 300px;*/ 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-  </style> 
-</html> 
 ====== timeit ====== ====== timeit ======
 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
行 80: 行 52:
 timeit.template を変更して、処理時間と戻り値を返却するようする。\\ timeit.template を変更して、処理時間と戻り値を返却するようする。\\
 **timeit.template (オリジナル)**\\ **timeit.template (オリジナル)**\\
-<WRAP prewrap 100% #mincode>+<WRAP prewrap 100% mincode>
 <code python> <code python>
 template = """ template = """
行 96: 行 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 = """
行 111: 行 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
行 128: 行 100:
 </WRAP> </WRAP>
  
-<WRAP prewrap 100% #mincode_long>+<WRAP prewrap 100% mincode_long>
 <code python> <code python>
 class Timer: class Timer:
行 186: 行 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,
行 195: 行 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.1585271323.txt.gz
  • 最終更新: 2020/03/27 10:08
  • by ともやん