How to get MariaDB (MySql) query time?
Set long_query_time=0 and turn on the slowlog to a FILE (in my.cnf, and restart).  Then the slowlog will contain a variety of info about every command executed, including the query time.

You might also want to run pt-query-digest to summarize the slow log.  This will include min/max/avg/etc for each 'different' query.