A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://gist.github.com/nascheme/0bff5c49bb6b518f5ce23a9aea27f14b below:

Pretty printer for module import dtrace output · GitHub

Created September 5, 2017 22:51

Clone this repository at <script src="https://gist.github.com/nascheme/0bff5c49bb6b518f5ce23a9aea27f14b.js"></script>

Save nascheme/0bff5c49bb6b518f5ce23a9aea27f14b to your computer and use it in GitHub Desktop.

Pretty printer for module import dtrace output

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters !/usr/bin/env python3 # # Pretty print module import dtrace output. First column is elapsed time in ms. Second column is % of total time. import sys import fileinput def main(): first = None lines = [] for line in fileinput.input(): if not line.strip(): break ts, _, rest = line.partition('\t') ts = int(ts) rest = rest.strip() if first is None: first = ts ts = 0 else: ts -= first lines.append((ts, rest)) last = ts for ts, line in lines: print('%8.3f %6.1f %s' % (float(ts)/1e6, 100*float(ts)/last, line)) if __name__ == '__main__': main()

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4