comparison contrib/perf.py @ 27307:f36dc0062b1a

perf: add getlen getlen will return 1 if perf.stub
author timeless <timeless@mozdev.org>
date Fri, 04 Dec 2015 19:05:32 +0000
parents bafb1235f505
children 7bc52ac46172
comparison
equal deleted inserted replaced
27306:bafb1235f505 27307:f36dc0062b1a
9 9
10 formatteropts = commands.formatteropts 10 formatteropts = commands.formatteropts
11 11
12 cmdtable = {} 12 cmdtable = {}
13 command = cmdutil.command(cmdtable) 13 command = cmdutil.command(cmdtable)
14
15 def getlen(ui):
16 if ui.configbool("perf", "stub"):
17 return lambda x: 1
18 return len
14 19
15 def gettimer(ui, opts=None): 20 def gettimer(ui, opts=None):
16 """return a timer function and formatter: (timer, formatter) 21 """return a timer function and formatter: (timer, formatter)
17 22
18 This function exists to gather the creation of formatter in a single 23 This function exists to gather the creation of formatter in a single