The function speed calculates the speed in km/h (metric units) or mph (imperial units) according to the units of measurement in your basic settings, for example
speed([Time10.Decimal])
If the distance shall not be the length of the contest, it can be added as a second paramter, this will use the unit from your contest settings.
The third parameter is optionally the unit as either:
meters - "m"
kilometers - "km"
miles - "miles"
For example
speed([Time10.Decimal]; 5)
speed([Time10.Decimal]; 5000; "m")
Using the format function the output can be formatted easily:
format(speed([Time10.Decimal]); "s.k") & " mph"