Skip to content

Commit 6ffb865

Browse files
committed
Add a test that measures time of executing Python function and then js
callback that was passed (Issue #277). Elapsed = 11 ms.
1 parent 15a2063 commit 6ffb865

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

unittests/main_test.py

+5
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@
5252
print("test_function() ok");
5353
5454
// Test binding external object and use of javascript<>python callbacks
55+
var start_time = new Date().getTime();
56+
print("[TIMER] Call Python function and then js callback that was"+
57+
" passed (Issue #277 test)");
5558
external.test_callbacks(function(msg_from_python, py_callback){
5659
if (msg_from_python == "String sent from Python") {
5760
print("test_callbacks() ok");
61+
var execution_time = new Date().getTime() - start_time;
62+
print("[TIMER]: Elapsed = "+String(execution_time)+" ms");
5863
} else {
5964
throw new Error("test_callbacks(): msg_from_python contains"+
6065
" invalid value");

0 commit comments

Comments
 (0)