I'm working on a study on existing open-source process runtime frameworks (such as jBPM, Apache ODE, etc.) wrt to flexibility, scalability, performance, and so on. With regard to jBPM execution time, I tried several examples such as the ones shown in  and . The initial experiment settings is to create a process having a fixed number of tasks (ranging from 100 to 1000), then invoke startProcessInstanceByKey() or startProcessInstance() surrounded by System.nanoTime() in order to measure the process's execution time.
(1) long startTime = System.nanoTime();
(2) ProcessInstance instance = executionService.startProcessInstanceByKey("Sequence1000");
(3) double executionTime = (System.nanoTime() - startTime) * 1.0e-6;
The preliminary measurement results seem to be very promising (~20ms for 1000 empty sequential tasks). However, I'm wondering if this measure is precise because the invocation of instance.isEnded() right after line (2) returns false (i.e., the process has not finished yet). Could somebody please show me how to precisely measure the execution time of a jBPM process (without looking to the underlying database tables)? Is there any convenient mechanism like callback or thing like that?
I truly appreciate your helps.