Skip to content
← Back to Community
RunTime
Profile icon
Knei

Is there any built-in way to show how long it took to run your code?

Example response:

Run()
Ran!
[Process finished in 0.1 seconds]

Answered by VulcanWM [earned 5 cycles]
View Answer
Voters
Profile icon
GiftAj
Profile icon
CakraypJhn6013276
Profile icon
Knei
Comments
hotnewtop
Profile icon
VulcanWM

Which language?
If Python then you can do the code below:

import datetime begin_time = datetime.datetime.now() #whatever function you want to do runtime = datetime.datetime.now() - begin_time
Profile icon
Knei

@VulcanWM I use python so this works thanks!

Profile icon
VulcanWM

np! :) @Knei