Measuring time in gsql query

Hello,
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
Regards
Meghana.Ponnuru

No problem. See Szilard’s answer here: http://dev.tigergraph.com/forum/t/how-to-time-the-graph-algorithm-execution/384/3

2 Likes

@Richard_Henderson, 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>;
}