Creating a template variable that gives the time range in ms

Can this be done with Grafana? I’m doing some calculations in a SQL query that would display operations per second in a singlestat panel, and I’m having a hard time getting the number of seconds from the $timeFilter to be used in the query. Is there a better way to do this?

Any feedback would be much appriciated. Thanks!


This only got merged very recently:

So it works in the latest master (available via docker hub) and will be released in the next version of Grafana in January.