Reputation: 110
Is there a way to fetch runtime of a particular cell in data bricks Notebook using Pyspark?
Upvotes: 1
Views: 5061
Reputation: 110
import time
start = time.time()
time.sleep(3)
end = time.time()
diff=end - start
print(diff)
I was able to achieve my requirement with above code
Upvotes: 1
Reputation: 12768
You can do this by calling System.nanoTime (Scala). When using Spark with Scala, a way to execute code and measure its elapsed time is by using: spark.time(
Note: You can use the run multiple languages in the notebooks using %magic commands.
OR
Upvotes: 0