def profile(xhtml, widths=[800,600,400,200,100], runs=3):
    for i in range(runs):
        start = time.time()
        layout = Layout()
        layout.set_xhtml(xhtml)
        print_time(start, 'create layout')
    for width in widths:
        for i in range(runs):
            start = time.time()
            layout.viewport_width = width
            layout.draw()
            print_time(start, 'layout width=%d' % width)
        for i in range(runs):
            start = time.time()
            layout.draw()
            print_time(start, width % 'draw width=%d')
dataset/ETHPy150Open ardekantur/pyglet/experimental/profile_layout.py/profile/swapped operands of `%`