Sometimes we're used to recieve service request that our customers needs to know the time spent in order to connect to their Azure SQL Database or Managed Instance or simply to check intermittent connections that they could have in their environment.
For these types of situation I would like to suggest to review two PowerShell Script that you could find on this URL that allow to obtain this information.
Enjoy!