@@ -17,16 +17,14 @@ msgstr ""
1717"Generated-By : Babel 2.17.0\n "
1818
1919#: ../../library/timeit.rst:2
20- #, fuzzy
2120msgid ":mod:`!timeit` --- Measure execution time of small code snippets"
22- msgstr ":mod:`timeit` --- 작은 코드 조각의 실행 시간 측정"
21+ msgstr ":mod:`! timeit` --- 작은 코드 조각의 실행 시간 측정"
2322
2423#: ../../library/timeit.rst:7
2524msgid "**Source code:** :source:`Lib/timeit.py`"
2625msgstr "**소스 코드:** :source:`Lib/timeit.py`"
2726
2827#: ../../library/timeit.rst:15
29- #, fuzzy
3028msgid ""
3129"This module provides a simple way to time small bits of Python code. It "
3230"has both a :ref:`timeit-command-line-interface` as well as a "
@@ -37,7 +35,7 @@ msgid ""
3735msgstr ""
3836"이 모듈은 파이썬 코드의 작은 조각의 시간을 측정하는 간단한 방법을 제공합니다. :ref:`timeit-command-line-"
3937"interface`\\ 뿐만 아니라 :ref:`콜러블 <python-interface>`\\ 도 있습니다. 실행 시간을 측정에 따르는 "
40- "흔한 함정들을 피할 수 있습니다. O'Reilly가 출판한 *Python Cookbook*\\ 에 있는 Tim Peters의 "
38+ "흔한 함정들을 피할 수 있습니다. O'Reilly가 출판한 *Python Cookbook* 2판에 있는 Tim Peters의 "
4139"\" Algorithms\" 장의 개요도 참조하십시오."
4240
4341#: ../../library/timeit.rst:23
@@ -61,6 +59,12 @@ msgid ""
6159"$ python -m timeit \" '-'.join(map(str, range(100)))\" \n"
6260"10000 loops, best of 5: 23.2 usec per loop"
6361msgstr ""
62+ "$ python -m timeit \" '-'.join(str(n) for n in range(100))\" \n"
63+ "10000 loops, best of 5: 30.2 usec per loop\n"
64+ "$ python -m timeit \" '-'.join([str(n) for n in range(100)])\" \n"
65+ "10000 loops, best of 5: 27.5 usec per loop\n"
66+ "$ python -m timeit \" '-'.join(map(str, range(100)))\" \n"
67+ "10000 loops, best of 5: 23.2 usec per loop"
6468
6569#: ../../library/timeit.rst:37
6670msgid "This can be achieved from the :ref:`python-interface` with::"
@@ -78,6 +82,15 @@ msgid ""
7882">>> timeit.timeit('\" -\" .join(map(str, range(100)))', number=10000)\n"
7983"0.23702679807320237"
8084msgstr ""
85+ ">>> import timeit\n"
86+ ">>> timeit.timeit('\" -\" .join(str(n) for n in range(100))', number=10000)"
87+ "\n"
88+ "0.3018611848820001\n"
89+ ">>> timeit.timeit('\" -\" .join([str(n) for n in range(100)])', "
90+ "number=10000)\n"
91+ "0.2727368790656328\n"
92+ ">>> timeit.timeit('\" -\" .join(map(str, range(100)))', number=10000)\n"
93+ "0.23702679807320237"
8194
8295#: ../../library/timeit.rst:47
8396msgid "A callable can also be passed from the :ref:`python-interface`::"
@@ -89,6 +102,9 @@ msgid ""
89102"\n"
90103"0.19665591977536678"
91104msgstr ""
105+ ">>> timeit.timeit(lambda: \" -\" .join(map(str, range(100))), number=10000)"
106+ "\n"
107+ "0.19665591977536678"
92108
93109#: ../../library/timeit.rst:52
94110msgid ""
@@ -143,6 +159,8 @@ msgid ""
143159"seconds. An alternative, time.perf_counter_ns, returns integer "
144160"nanoseconds."
145161msgstr ""
162+ "기본 타이머, 항상 time.perf_counter() 이고, 초 단위의 float를 반환합니다. 대안인 "
163+ "time.perf_counter_ns 는 나노초 단위의 정수를 반환합니다."
146164
147165#: ../../library/timeit.rst:95
148166msgid ":func:`time.perf_counter` is now the default timer."
@@ -197,7 +215,6 @@ msgstr ""
197215"타이밍 오버헤드가 약간 더 커집니다."
198216
199217#: ../../library/timeit.rst:127
200- #, fuzzy
201218msgid ""
202219"Time *number* executions of the main statement. This executes the setup "
203220"statement once, and then returns the time it takes to execute the main "
@@ -207,8 +224,8 @@ msgid ""
207224"function to be used are passed to the constructor."
208225msgstr ""
209226"주 문장의 *number* 실행의 시간을 측정합니다. setup 문장을 한 번 실행한 다음, 주 문장을 여러 번 실행하는 데 걸리는"
210- " 시간을 초 단위로 float로 반환합니다. 인자는 루프를 통과하는 횟수이며, 기본값은 백만입니다. 주 문장, setup 문장 및 "
211- "사용할 타이머 함수는 생성자에 전달됩니다."
227+ " 시간을 반환합니다. 기본 타이머는 초 단위의 float를 반환합니다. 인자는 루프를 통과하는 횟수이며, 기본값은 백만입니다. 주 "
228+ "문장, setup 문장 및 사용할 타이머 함수는 생성자에 전달됩니다."
212229
213230#: ../../library/timeit.rst:136
214231msgid ""
@@ -226,14 +243,13 @@ msgstr ""
226243
227244#: ../../library/timeit.rst:143
228245msgid "timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()"
229- msgstr ""
246+ msgstr "timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit() "
230247
231248#: ../../library/timeit.rst:148
232249msgid "Automatically determine how many times to call :meth:`.timeit`."
233250msgstr ":meth:`.timeit`\\ 를 호출하는 횟수를 자동으로 결정합니다."
234251
235252#: ../../library/timeit.rst:150
236- #, fuzzy
237253msgid ""
238254"This is a convenience function that calls :meth:`.timeit` repeatedly so "
239255"that the total time >= 0.2 second, returning the eventual (number of "
@@ -302,6 +318,11 @@ msgid ""
302318"except Exception:\n"
303319" t.print_exc()"
304320msgstr ""
321+ "t = Timer(...) # try/except 바깥\n"
322+ "try:\n"
323+ " t.timeit(...) # 또는 t.repeat(...)\n"
324+ "except Exception:\n"
325+ " t.print_exc()"
305326
306327#: ../../library/timeit.rst:199
307328msgid ""
@@ -327,6 +348,8 @@ msgid ""
327348"python -m timeit [-n N] [-r N] [-u U] [-s S] [-p] [-v] [-h] [statement "
328349"...]"
329350msgstr ""
351+ "python -m timeit [-n N] [-r N] [-u U] [-s S] [-p] [-v] [-h] [statement "
352+ "...]"
330353
331354#: ../../library/timeit.rst:213
332355msgid "Where the following options are understood:"
@@ -353,11 +376,12 @@ msgstr ""
353376":func:`time.process_time`\\ 을 사용합니다"
354377
355378#: ../../library/timeit.rst:238
356- #, fuzzy
357379msgid ""
358380"specify a time unit for timer output; can select ``nsec``, ``usec``, "
359381"``msec``, or ``sec``"
360- msgstr "타이머 출력의 시간 단위를 지정합니다; nsec, usec, msec 또는 sec 중에서 선택할 수 있습니다."
382+ msgstr ""
383+ "타이머 출력의 시간 단위를 지정합니다; ``nsec``, ``usec``, ``msec`` 또는 ``sec`` 중에서 선택할 수 "
384+ "있습니다."
361385
362386#: ../../library/timeit.rst:244
363387msgid "print raw timing results; repeat for more digits precision"
@@ -429,6 +453,12 @@ msgid ""
429453"\" text.find(char)\" \n"
430454"1000000 loops, best of 5: 0.342 usec per loop"
431455msgstr ""
456+ "$ python -m timeit -s \" text = 'sample string'; char = 'g'\" \" char in "
457+ "text\" \n"
458+ "5000000 loops, best of 5: 0.0877 usec per loop\n"
459+ "$ python -m timeit -s \" text = 'sample string'; char = 'g'\" "
460+ "\" text.find(char)\" \n"
461+ "1000000 loops, best of 5: 0.342 usec per loop"
432462
433463#: ../../library/timeit.rst:287
434464msgid ""
@@ -450,6 +480,13 @@ msgid ""
450480"char = \" g\" ')\n"
451481"1.7246671520006203"
452482msgstr ""
483+ ">>> import timeit\n"
484+ ">>> timeit.timeit('char in text', setup='text = \" sample string\" ; char ="
485+ " \" g\" ')\n"
486+ "0.41440500499993504\n"
487+ ">>> timeit.timeit('text.find(char)', setup='text = \" sample string\" ; "
488+ "char = \" g\" ')\n"
489+ "1.7246671520006203"
453490
454491#: ../../library/timeit.rst:302
455492msgid "The same can be done using the :class:`Timer` class and its methods::"
@@ -466,6 +503,14 @@ msgid ""
466503"[0.40183617287970225, 0.37027556854118704, 0.38344867356679524, "
467504"0.3712595970846668, 0.37866875250654886]"
468505msgstr ""
506+ ">>> import timeit\n"
507+ ">>> t = timeit.Timer('char in text', setup='text = \" sample string\" ; "
508+ "char = \" g\" ')\n"
509+ ">>> t.timeit()\n"
510+ "0.3955516149999312\n"
511+ ">>> t.repeat()\n"
512+ "[0.40183617287970225, 0.37027556854118704, 0.38344867356679524, "
513+ "0.3712595970846668, 0.37866875250654886]"
469514
470515#: ../../library/timeit.rst:312
471516msgid ""
@@ -492,6 +537,17 @@ msgid ""
492537"$ python -m timeit \" if hasattr(int, '__bool__'): pass\" \n"
493538"100000 loops, best of 5: 2.23 usec per loop"
494539msgstr ""
540+ "$ python -m timeit \" try:\" \" str.__bool__\" \" except AttributeError:\" "
541+ " \" pass\" \n"
542+ "20000 loops, best of 5: 15.7 usec per loop\n"
543+ "$ python -m timeit \" if hasattr(str, '__bool__'): pass\" \n"
544+ "50000 loops, best of 5: 4.26 usec per loop\n"
545+ "\n"
546+ "$ python -m timeit \" try:\" \" int.__bool__\" \" except AttributeError:\" "
547+ " \" pass\" \n"
548+ "200000 loops, best of 5: 1.43 usec per loop\n"
549+ "$ python -m timeit \" if hasattr(int, '__bool__'): pass\" \n"
550+ "100000 loops, best of 5: 2.23 usec per loop"
495551
496552#: ../../library/timeit.rst:330
497553msgid ""
@@ -522,6 +578,32 @@ msgid ""
522578">>> timeit.timeit(stmt=s, number=100000)\n"
523579"0.08588060699912603"
524580msgstr ""
581+ ">>> import timeit\n"
582+ ">>> # 어트리뷰트가 없습니다\n"
583+ ">>> s = \"\"\"\\ \n"
584+ "... try:\n"
585+ "... str.__bool__\n"
586+ "... except AttributeError:\n"
587+ "... pass\n"
588+ "... \"\"\" \n"
589+ ">>> timeit.timeit(stmt=s, number=100000)\n"
590+ "0.9138244460009446\n"
591+ ">>> s = \" if hasattr(str, '__bool__'): pass\" \n"
592+ ">>> timeit.timeit(stmt=s, number=100000)\n"
593+ "0.5829014980008651\n"
594+ ">>>\n"
595+ ">>> # 어트리뷰트가 있습니다\n"
596+ ">>> s = \"\"\"\\ \n"
597+ "... try:\n"
598+ "... int.__bool__\n"
599+ "... except AttributeError:\n"
600+ "... pass\n"
601+ "... \"\"\" \n"
602+ ">>> timeit.timeit(stmt=s, number=100000)\n"
603+ "0.04215312199994514\n"
604+ ">>> s = \" if hasattr(int, '__bool__'): pass\" \n"
605+ ">>> timeit.timeit(stmt=s, number=100000)\n"
606+ "0.08588060699912603"
525607
526608#: ../../library/timeit.rst:358
527609msgid ""
@@ -541,6 +623,13 @@ msgid ""
541623" import timeit\n"
542624" print(timeit.timeit(\" test()\" , setup=\" from __main__ import test\" ))"
543625msgstr ""
626+ "def test():\n"
627+ " \"\"\" 멍청한 테스트 함수\"\"\" \n"
628+ " L = [i for i in range(100)]\n"
629+ "\n"
630+ "if __name__ == '__main__':\n"
631+ " import timeit\n"
632+ " print(timeit.timeit(\" test()\" , setup=\" from __main__ import test\" ))"
544633
545634#: ../../library/timeit.rst:369
546635msgid ""
@@ -564,15 +653,21 @@ msgid ""
564653"import timeit\n"
565654"print(timeit.timeit('[func(42) for func in (f,g,h)]', globals=globals()))"
566655msgstr ""
656+ "def f(x):\n"
657+ " return x**2\n"
658+ "def g(x):\n"
659+ " return x**4\n"
660+ "def h(x):\n"
661+ " return x**8\n"
662+ "\n"
663+ "import timeit\n"
664+ "print(timeit.timeit('[func(42) for func in (f,g,h)]', globals=globals()))"
567665
568666#: ../../library/timeit.rst:9
569667msgid "Benchmarking"
570- msgstr ""
668+ msgstr "벤치마킹 "
571669
572670#: ../../library/timeit.rst:9
573671msgid "Performance"
574- msgstr ""
575-
576- #~ msgid "The default timer, which is always :func:`time.perf_counter`."
577- #~ msgstr "기본 타이머, 항상 :func:`time.perf_counter`\\입니다."
672+ msgstr "성능"
578673
0 commit comments