summaryrefslogtreecommitdiffstats
path: root/python/mach/mach/test/zero_microseconds.py
blob: b1d523071f4c7cc2aa6b1024b450bb13285ba533 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# This code is loaded via `mach python --exec-file`, so it runs in the scope of
# the `mach python` command.
old = self._mach_context.post_dispatch_handler  # noqa: F821


def handler(context, handler, instance, result, start_time, end_time, depth, args):
    global old
    # Round off sub-second precision.
    old(context, handler, instance, result, int(start_time), end_time, depth, args)


self._mach_context.post_dispatch_handler = handler  # noqa: F821