Formula in a computed field:
_diff := Time1 - Time2;
@If( @IsError( _diff ); 0; _diff )
If the field is of type date time, then you get the difference in hours/minutes If the field is of type number, then you get the difference in seconds.
Don't forget the @IsError, otherwise your form will not open unless you have valid default values for Time1 and Time2