Return something from an invokeAsync/invokeLater pair

See this thread and the later.py script linked within. You’d want to look at the assignLater() function.
As for timing, simply instantiate a new java.lang.Date object at suitable points, and subtract their raw milliseconds (via .getTime()) to yield a millisecond interval. If you need more precision, consider using java.lang.System.nanoTime(), but beware of poor multiprocessor implementations.