diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /python/mach/mach/test/zero_microseconds.py | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'python/mach/mach/test/zero_microseconds.py')
-rw-r--r-- | python/mach/mach/test/zero_microseconds.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/mach/mach/test/zero_microseconds.py b/python/mach/mach/test/zero_microseconds.py new file mode 100644 index 0000000000..c32ea5b1d5 --- /dev/null +++ b/python/mach/mach/test/zero_microseconds.py @@ -0,0 +1,16 @@ +# Make flake8, ruff and autodoc happy +if "self" not in globals(): + self = None + +# 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 + + +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 |