We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f7520d commit d8e1a5aCopy full SHA for d8e1a5a
1 file changed
examples/bench_event_loop.erl
@@ -0,0 +1,22 @@
1
+#!/usr/bin/env escript
2
+%% -*- erlang -*-
3
+%%! -pa _build/default/lib/erlang_python/ebin
4
+
5
+%%% @doc Benchmark script for event loop performance.
6
+%%%
7
+%%% Run with:
8
+%%% rebar3 compile && escript examples/bench_event_loop.erl
9
10
+-mode(compile).
11
12
+main(_Args) ->
13
+ {ok, _} = application:ensure_all_started(erlang_python),
14
+ {ok, _} = py:start_contexts(),
15
16
+ Code = <<"exec(open('examples/benchmark_event_loop.py').read())">>,
17
+ case py:exec(Code) of
18
+ ok -> ok;
19
+ {error, E} -> io:format("Error: ~p~n", [E])
20
+ end,
21
22
+ halt(0).
0 commit comments