The hospital ones measure several things, but peak flow rate is the key which urologists are interested in. That indicates how obstructed your urethra is (although that's not the only possible cause of poor flow - damaged bladder/detrusor muscle can cause it too).
I made myself one by ripping the circuit out of a cheap electronic kitchen scales and putting a Raspberry Pi Zero W inside. It reports total volume, peak flow rate, and how many seconds after you started peeing the peak flow rate was reached. It uploads the results to a server over WiFi too.
A couple of urologists played with it at a support group meeting, pouring water in to it. They said the expensive flow meters in urology don't work, because a man who can normally pee at a very respectable 25ml/s comes in to the urology department all anxious, and struggles to pee at 8ml/s. Doing the test at home would be much more useful.
Someone sells a kit to make a microcontroller based one now.