Gremlin Console中时间测量单位(毫秒/秒)及clock()结果咨询
Gremlin Console
clock() Method: Time Unit Clarification Great question! Let's clear this up straight away:
- The
clock()method in Gremlin Console returns time in seconds as a floating-point number. The decimal portion represents fractions of a second. - Your result
0.23456789translates to roughly 234.57 milliseconds (since 0.23456789 × 1000 ≈ 234.57).
To put this in context, here's how you'd typically use clock() to measure query execution time:
// Measure how long it takes to count all vertices clock({ g.V().count().next() })
This returns the exact time taken in seconds, down to nanosecond precision (which is why you see so many decimal places).
If you prefer working with milliseconds instead, it's easy to convert the result:
def executionTimeSec = clock({ g.V().hasLabel('person').values('name').toList() }) def executionTimeMs = executionTimeSec * 1000 println("Query took ${executionTimeMs} milliseconds")
内容的提问来源于stack exchange,提问作者annagnu
相关产品推荐
相关产品推荐

