From 2adcc9ee0c150a7831c4c9440b2a2ca526a1c1d1 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 24 Apr 2022 09:08:02 +0100 Subject: [PATCH] black --- tools/profile_split.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tools/profile_split.py diff --git a/tools/profile_split.py b/tools/profile_split.py new file mode 100644 index 00000000..73c20294 --- /dev/null +++ b/tools/profile_split.py @@ -0,0 +1,14 @@ +from rich.segment import Segment + +text = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.""" + + +segments = [Segment(text[n : n + 7]) for n in range(0, len(text), 7)] + + +from time import perf_counter + +start = perf_counter() +for _ in range(10000): + list(Segment.divide(segments, [0, 1, 20, 24, 65, len(text)])) +print(perf_counter() - start)