You appear to be confusing milliseconds and microseconds.
%Diff using *MSECONDS gives _
microseconds_ not milliseconds.
So dividing by 1,000,000 is correct.
Two other points.
First - if you want seconds then why not ask %Diff for seconds to begin with? If you want decimals of seconds you can specify the accuracy you require. From the manual "If the third operand is *SECONDS or *S, and both of the operands are timestamps, you can specify a fourth parameter indicating the number of fractional seconds to return. You can specify a value between 0 and 12. This represents the number of decimal positions in the returned number of seconds."
Second: Use integers when appropriate. In your original code there is no point in defining milliseconds as 15,5 - it should just be (say) an int(10).
As to formatting the code. It is formatted in your example. By using the code tags you preserve leading and embedded spaces - so if you indent within a code block it is preserved.
Like this:
Code: Select all
No indentation
Three space indent
And again
Six spaces with big gaps
without the tag that data looks like this:
No indentation
Three space indent
And again
Six spaces with big gaps