How to time the graph algorithm execution

If it is OK to see the timing after the execution, try this:

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>;
}

and then you will see this in the result set:

{
    "timing": "Black magic took 5 seconds"
},

I don’t think we can measure <1s durations this way.

2 Likes