Various devices allow you to track distance covered while swimming.
2 notable ones are:
https://support.apple.com/en-us/HT209393
https://www.garmin.com/en-US/p/665374
Short of using a device, which can be expensive, you can guesstimate the distance you covered and do a manual entry on your...