Skip to content

Execution time Mojo > Python ? #161

Closed Locked Answered by mfranzon
survuvi asked this question in Q&A
Discussion options

You must be logged in to vote

You can use the built-in String struct instead of using python functions:

from String import String
from Time import now
mojo_t1 = now()
print(String("Hello Mojo")[0:5])
mojo_t2 = now()
print(mojo_t2 - mojo_t1) # 18128ns

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@survuvi
Comment options

Answer selected by survuvi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants