é¢æ°ã®ãµã¼ããçç¥ãã Pythonã®å¦çç³»ãé¢æ°ãå¼ã³åºãéããã®é¢æ°ããµã¼ãããæéãããããé¢æ°ãå¤æ°ã«æ ¼ç´ãã¦ãµã¼ããçç¥ãããã¨ã§ãå¦çé度ãæ¹åã§ããã æ¤è¨¼æ¹æ³ timeitã¢ã¸ã¥ã¼ã«ã使ããstring.atol()ã®å®è¡çµæã測å®ããããã®éãstringã¢ã¸ã¥ã¼ã«ãæå¹ã«ããããã«ãtimeitã®ç¬¬äºå¼æ°(ã¹ã¿ã¼ãã¢ããã³ã¼ã)ã«"import string"ãæå®ããã å®è¡çµæ >>> import timeit >>> timeit.Timer('string.atol("1000")', 'import string').timeit(10000) 0.008614782046606706 >>> timeit.Timer('m("1000")', 'import string\nm=string.atol') 0.0078415692496491829 ãã®ä¾
{{#tags}}- {{label}}
{{/tags}}