I'm told by others on this forum that the Ujagd was not a uboat thing. It seems to be disappearing from recent supermods. However the basic technique of timing the target past a fixed point to get speed is valid. You really need to be more or less stationary or, at a pinch, moving directly towards the target to get a good answer.
To do the calculation you can either use one of the tools provided by various mods or simply double the target length in metres and divide by the time to pass a fixed point in seconds. This gives speed in knots since 1 knot=0.52m/s. When sober I can do the division to the nearest knot in my head.

Of course in real life it was unlikely you would know the target length as there were too many different ship types.