I find your requirement interesting, as it is quite common for a ticketing system.
SharePoint can't do this natively, the reason being that the created and modified dates get written when an item is actually inserted and updated. You need to track the time spent on a form, that is the timespan between the click on the "add new item"/"edit item" button and the click on the "save" button.
The complete receipt is as follow:
- add a new column of time Number to your list. Call it eg. timespan
- in SharePoint designer: create a new "new form" and new "edit form" and set them as the default for your list.
var startTime = Date.now();
add a PreSaveAction function that will get called when the save button is clicked:
var endTime = Date.now();
var elapsed = (endTime - startTime) / 1000; // total number of seconds
var timespanFieldValue = $('[title="timespan"]').val(); //current timespan (this should have some value if in edit form)
var currentTimespan = isNaN(parseInt(timespanFieldValue )) ? 0 : parseInt(timespanFieldValue);
$('[title="timespan"]').val(currentTimespan + elapsed);