If you want to save the start and end time of the process you have designed in a variable and run my process, you can use the “Script Task” component under “Activities” at the beginning and end of the process. It will be enough to use the code below with JavaScript inside the component.
var date = new Date();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var milliseconds = date.getMilliseconds();
var current_time = hours + "." + minutes + "." + seconds + "." + milliseconds;
execution.setVariable("current_time", current_time);