Sorry it took a while to get back to you. I have created a demo that works for the regular, non-multithreaded case. It gets the time in python whenever there is a mouse click on the test button, then gets the time in javascript, then gets the time once more in python for the callback. It outputs the py->js time, the js->py time, and the total time (py->py). A gist containing this can be found
. In my testing on windows, I found the following results after 8 clicks/trials:
0.0130000114441 0.010999917984 0.0239999294281
0.0210001468658 0.00699996948242 0.0280001163483
0.0319998264313 0.00999999046326 0.0419998168945
0.0250000953674 0.010999917984 0.0360000133514
0.0199999809265 0.0119998455048 0.0319998264313
0.0280001163483 -0.00100016593933 0.0269999504089
0.0179998874664 0.00300002098083 0.0209999084473
0.0220000743866 0.0 0.0220000743866
This is definitely not perfect (the javascript time and python's time are different and can result in negative differences), but I think it is fair to say that the majority of the time spent is in going from python to javascript and not the reverse.
However, I cannot seem to get the multithreaded system working as I keep running into this error:
AssertionError: cefpython.CreateBrowserSync() may only be called on the UI thread
Any ideas to get this working? Is there a different way to create the initial browser window that I should be using instead?