When you subtract one time from another, the result is a time duration with units of seconds. You can remove the units by adding this line:
set entry's units to empty
That will make entry into a plain number with no units.
I’m not sure why the number is being rounded to 1 when you insert it into the database, but I would guess you may be entering it into a column that’s defined as an integer?
And the column is formatted as Decimal. I have tried it several times with long running operations as well and all time values get rounded and inserted into the DB