Measuring time in gsql query

I would like to know the commands to measure time taken to run a gsql query (apart from time command in linux machines). I would like to add the command inside gsql query.

Thank you

No problem. See Szilard’s answer here:

1 Like

@rik, the answer works, but only in seconds, if I want milliseconds, how can I change the syntax?

CREATE QUERY MyQuery(...) FOR GRAPH MyGraph { 

	  DATETIME before;
	  start = SomeVertex.*;
	  before = now();

	  <black magic here>
	  PRINT("Black magic took " + to_string(datetime_diff(now(), before)) + " seconds") AS timing;
	  PRINT <black magic results>;