How to calculate EXECUTION TIME in Java! ⏱️

preview_player
Показать описание
How to calculate execution time of a program tutorial example explained

This can be a helpful way to find the execution time if the Big O notation is somewhere between a best case and worst case.

For example: A user can adjust the clock during execution, even to a past date, and this would give you negative time.

#calculate #execution #time
Рекомендации по теме
Комментарии
Автор

IMPORTANT NOTES:

1. This can be a helpful way to find the execution time if the Big O notation is somewhere between a best case and worst case.

2. I would not recommend using System.currentTimeMillis(), it's tied to your OS.
For example: A user can adjust the clock during execution, even to a past data, and this would give you negative time.

public class Main {

public static void main(String[] args) throws InterruptedException{

long start = System.nanoTime();

// program

Thread.sleep(3000);

//

long duration = (System.nanoTime() -
System.out.println(duration + "ms");
}
}

BroCodez
Автор

I reached the end of this tutorial, and all I can say is THANK YOU FROM THE DEEP OF MY HEART.
Respect++

redaboukdir
Автор

It took me 2 months to watch all of your 125 videos from this Java playlist. Thank you, thank you, thank you! This is the definition of a quality content on YouTube! Now it's time to put this all into practice, learn more and finally land my dream job of a software developer! 🥳

BohdanAndrashko
Автор

OMG!
literally EXACTLY what i was looking for
how come NO ONE else made a video about something like this

tughloksiddiquee
Автор

Thank you for your time and tutorials. We need more tutorials on Algorithms

qurdedu
Автор

I made it thru the whole course. This was fantastic and I learned so much following along with you. I wish there some more real-world examples of some of the more advanced topics like Data Structure & Algorhytms so I could put it to practice to solidify the foundation you set up here. Thanks for being a bro, bro.

prizepig
Автор

I finished this tutorial and I want to say you big thanks for your effort, it was helpful for me❤

tmknktx
Автор

Bro you are really serving you world, true definition of chosen one for this task

yusuphmwaigomole
Автор

I have suggested your videos in every struggling student in my university. You are awesome.

manosmakris
Автор

Just finished the ds & al playlist. Appreciate the work you put into this bro!

ainsire
Автор

I have just finished your course on data structures and algorithms. Thank you for the effort that you made and the time that you spent preparing these lectures. Wish you all the best Bro!!!

adamg
Автор

Who needs udemy when you have legends like this guy giving us knowledge for free

iamnexom
Автор

And finally I reached the of this great tutorial. Thanks for everything...!

mohammadramzi
Автор

dont know how i am just finding this channel, but you are a God send keep being awesome bro

-dsenpai
Автор

This is the exact video, I was in search of!!
Thank you very much Sir!

vmin
Автор

Thank you Bro for all these helpful videos!
YOU ARE THE BEST🫶

erginrusheku
Автор

Great video if you make tutorial about frontend android development will be more good for beginners like me.😁

sumdara
Автор

In program what we have to write whole program from libraries to last or only classes

gALAXy-cartoon
Автор

thank you for the tutorial i like kitkat

paquale
Автор

👍Hi pros! Everything is cool, but can I ask you to comment on your video slower? I'm primitive and I don't have time to translate what you say in sync. Thanks for your hard work!

didierbrunet
join shbcf.ru