Skip to content

Instantly share code, notes, and snippets.

@shubhamkumar13
Last active November 18, 2020 09:08
Show Gist options
  • Select an option

  • Save shubhamkumar13/6b699a1b4a6c6b1f578e42d2358f2505 to your computer and use it in GitHub Desktop.

Select an option

Save shubhamkumar13/6b699a1b4a6c6b1f578e42d2358f2505 to your computer and use it in GitHub Desktop.
compare the diffs inside the logs generated
>>> f = open("/home/sk/ocaml/diff_linear.log", "r")
>>> f1 = f.readlines()
>>> counter = 0
>>> for x in f1:
... counter += 1
...
>>> print(counter)
163
>>> counter = 0
>>> for x in f1:
... if x == '> this is inside caml_request_minor_gc\n':
... counter += 1
...
>>> print(counter)
39
>>> counter_2 = 0
>>> for x in f1:
... if x == '< this is inside caml_request_minor_gc\n':
... counter_2 += 1
...
>>> print(counter_2)
25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment