Show More
@@ -915,7 +915,7 b' python-profiler package from non-free.""")' | |||||
915 | Number of times to execute `run`. |
|
915 | Number of times to execute `run`. | |
916 |
|
916 | |||
917 | """ |
|
917 | """ | |
918 |
twall0 = time.t |
|
918 | twall0 = time.perf_counter() | |
919 | if nruns == 1: |
|
919 | if nruns == 1: | |
920 | t0 = clock2() |
|
920 | t0 = clock2() | |
921 | run() |
|
921 | run() | |
@@ -938,7 +938,7 b' python-profiler package from non-free.""")' | |||||
938 | print(" Times : %10s %10s" % ('Total', 'Per run')) |
|
938 | print(" Times : %10s %10s" % ('Total', 'Per run')) | |
939 | print(" User : %10.2f s, %10.2f s." % (t_usr, t_usr / nruns)) |
|
939 | print(" User : %10.2f s, %10.2f s." % (t_usr, t_usr / nruns)) | |
940 | print(" System : %10.2f s, %10.2f s." % (t_sys, t_sys / nruns)) |
|
940 | print(" System : %10.2f s, %10.2f s." % (t_sys, t_sys / nruns)) | |
941 |
twall1 = time.t |
|
941 | twall1 = time.perf_counter() | |
942 | print("Wall time: %10.2f s." % (twall1 - twall0)) |
|
942 | print("Wall time: %10.2f s." % (twall1 - twall0)) | |
943 |
|
943 | |||
944 | @skip_doctest |
|
944 | @skip_doctest |
@@ -58,13 +58,13 b' try:' | |||||
58 | return resource.getrusage(resource.RUSAGE_SELF)[:2] |
|
58 | return resource.getrusage(resource.RUSAGE_SELF)[:2] | |
59 | except ImportError: |
|
59 | except ImportError: | |
60 | # There is no distinction of user/system time under windows, so we just use |
|
60 | # There is no distinction of user/system time under windows, so we just use | |
61 |
# time. |
|
61 | # time.perff_counter() for everything... | |
62 |
clocku = clocks = clock = time. |
|
62 | clocku = clocks = clock = time.perf_counter | |
63 | def clock2(): |
|
63 | def clock2(): | |
64 | """Under windows, system CPU time can't be measured. |
|
64 | """Under windows, system CPU time can't be measured. | |
65 |
|
65 | |||
66 |
This just returns |
|
66 | This just returns perf_counter() and zero.""" | |
67 |
return time. |
|
67 | return time.perf_counter(),0.0 | |
68 |
|
68 | |||
69 |
|
69 | |||
70 | def timings_out(reps,func,*args,**kw): |
|
70 | def timings_out(reps,func,*args,**kw): |
General Comments 0
You need to be logged in to leave comments.
Login now