Тёмный

Time Library | C Programming Tutorial 

Portfolio Courses
Подписаться 220 тыс.
Просмотров 45 тыс.
50% 1

Опубликовано:

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 91   
@warplanner8852
@warplanner8852 2 месяца назад
46 years as a software developer (over half doing C/C++) and this is the most succinct and complete example of the UNIX/LINUX time code without the pages and pages of boilerplate. You are a true craftsman!
@khetanshusingh9059
@khetanshusingh9059 3 месяца назад
I've been searching a video to print current time of my system from past 2 days. Then, suddenly your video got recommended today and I must say that this video is an upgrade of what I wanted in first place. Best tutorial on this topic.❤ Thanks a lot.
@nickklotz4333
@nickklotz4333 2 года назад
Thank you so much for making this video! I can't even explain how helpful this was.
@PortfolioCourses
@PortfolioCourses 2 года назад
You’re welcome! I’m very glad to hear it was helpful for you. :-)
@fifaham
@fifaham Год назад
The "strftime()" at @16:50 comes in very handy for embedded designers because they can specifically tailor the output based on various features requirements. I will definitely consider using it in my next project. In embedded design we usually use a chip called Real-Time-Clock (RTC) and follow instructions on data sheet to how to format the output. This makes it very powerful to interface the RTC of the PC with the Embedded device for real embedded action.
@PortfolioCourses
@PortfolioCourses Год назад
Thank you for sharing this! :-)
@mortenlund1418
@mortenlund1418 2 месяца назад
You are eminent at doing this stuff! Thanks for sharing. Very much.
@towtruckn
@towtruckn Год назад
Thank you for the great video I was playing around with this for hours and learnt so much. With the strftime() function all of the format specifiers are identical to those given in the man page for the date command. The specifiers for its default output are "%a %d %b %Y %X %Z" if anyone is interested. Hope this helps
@PortfolioCourses
@PortfolioCourses Год назад
You're welcome and thank you for sharing this! :-)
@u12blue
@u12blue 2 года назад
I've been looking for a channel like this for a very long time!!! Thank you so much for making this video!!!
@PortfolioCourses
@PortfolioCourses 2 года назад
You’re welcome! :-)
@thundercloud-7913
@thundercloud-7913 2 года назад
very good video, been looking after content like this of c programming during weeks and wasn't able to find anything good enough like this
@PortfolioCourses
@PortfolioCourses 2 года назад
Thank you very much for the kind feedback, I'm glad to hear you enjoyed the video! :-D
@fifaham
@fifaham Год назад
@20:24 This is very useful to measure events or signal parameters, we call it Timer Capture and Compare in Embedded design, where the MCU counts the number of clocks elapsed between the start of measuring time and the end of measurement, or counting the number of clocks over the incident latency. We use the Capture and Compare to also create certain wave forms with specific parameters and accuracy of near microsecond.
@PortfolioCourses
@PortfolioCourses Год назад
Very cool! :-)
@shvideo1
@shvideo1 2 года назад
I echo the other comments. Excellent C tutorial. Thank you for putting it together.
@PortfolioCourses
@PortfolioCourses 2 года назад
You're welcome too! :-D
@arjunmandavkar8597
@arjunmandavkar8597 2 года назад
Very useful. Thank you man.
@PortfolioCourses
@PortfolioCourses 2 года назад
Glad to hear you enjoyed it, and you're welcome! :-D
@TheSquareClasses
@TheSquareClasses 2 года назад
You are awesome. You explained it very simply. I am no words for thanking you. Love you man ❤️❤️.
@PortfolioCourses
@PortfolioCourses 2 года назад
Aww I'm so glad you enjoyed it, you're very welcome! 😀
@sigmage5345
@sigmage5345 2 года назад
Thanks for this awesome and useful video!
@PortfolioCourses
@PortfolioCourses 2 года назад
You're welcome! :-D
@HamzahChaudhry
@HamzahChaudhry 6 месяцев назад
ty for the vid, def helped me out for my coding lab lol
@PortfolioCourses
@PortfolioCourses 6 месяцев назад
You’re welcome, that’s excellent to hear I helped you out! :-)
@saboten7584
@saboten7584 2 года назад
Thanks for the Amazing Lectures!
@PortfolioCourses
@PortfolioCourses 2 года назад
You’re welcome! :-)
@angeltorresloya
@angeltorresloya 10 месяцев назад
Thank you, I learned a lot fo things
@PortfolioCourses
@PortfolioCourses 10 месяцев назад
You’re welcome! :-)
@leythecg
@leythecg 11 месяцев назад
Great presentation and content! 👍👍👍
@exp3rim
@exp3rim 2 года назад
Thank you very much. It was very helpful.
@PortfolioCourses
@PortfolioCourses 2 года назад
You're welcome! :-D
@cd-stephen
@cd-stephen Год назад
great vid - love how you described epoch
@PortfolioCourses
@PortfolioCourses Год назад
Thank you for the kind feedback! 🙂
@cd-stephen
@cd-stephen Год назад
@@PortfolioCourses any chance of a series of c or cpp vids on making drivers in linux
@PortfolioCourses
@PortfolioCourses Год назад
@@cd-stephen Maybe one day I could do an introductory video on making drivers, but that's not my specialty so that's about as far as I could go with it I think. 🙂
@dewaldesterhuysen712
@dewaldesterhuysen712 Год назад
This helped, thank you for the time and effort.
@PortfolioCourses
@PortfolioCourses Год назад
You're welcome Dewald, I'm glad to hear that it helped! :-)
@abuaisha93
@abuaisha93 2 года назад
this vid is awesome. keep going
@PortfolioCourses
@PortfolioCourses 2 года назад
Thank you. :-D
@golladhanushkumar2991
@golladhanushkumar2991 2 года назад
Thank you very much for making this video ... It's helped me a lot 😊
@PortfolioCourses
@PortfolioCourses 2 года назад
You’re welcome! I’m glad to hear it helped you! :-)
@thomaschurch1969
@thomaschurch1969 11 месяцев назад
Awesome video, very well done.
@ismailchiba7002
@ismailchiba7002 Год назад
Thank you for the great video
@PortfolioCourses
@PortfolioCourses Год назад
You're welcome ismail! :-)
@alonsomadronal2919
@alonsomadronal2919 Год назад
Cool video! I really needed it, thanks!
@PortfolioCourses
@PortfolioCourses Год назад
You're welcome Alonso! 🙂
@gabrielveloz3296
@gabrielveloz3296 Год назад
never subscribed so fast before
@PortfolioCourses
@PortfolioCourses Год назад
Thank you so much Gabriel, that's awesome!!! 🙂
@vicsteiner
@vicsteiner 2 месяца назад
I just put sleep(1) between the start and end clocks expecting the total after to around 1.0s but I got much smaller values. What am I missing. Also if I execute the program multiple times the value for total varies even though sleep(1) should a constant time. Are the clock ticks not constant? Or maybe the waiting that the sleep function executes does not prevent the next clock to be executed somehow? Ah, so if sleep pauses the execution of a program would that mean that it stops somehow counting the clock ticks? so the value for the end clock is then not the one for the amount of ticks that would have been executed in the 1 sec equivalent?
@Aysx.
@Aysx. 5 месяцев назад
How can i calculate time on my own only using time () ? Without using any other Libraries and functions
@nrdfoss
@nrdfoss 2 года назад
best time tutorial on yt
@PortfolioCourses
@PortfolioCourses 2 года назад
Thank you very much! :-D
@nrdfoss
@nrdfoss 2 года назад
@@PortfolioCourses rather i should thank you, every tutorial or doc that i found was just barely not what i was looking for lol
@nrdfoss
@nrdfoss 2 года назад
or too hard for me to read
@PortfolioCourses
@PortfolioCourses 2 года назад
Haha well I’m glad to hear this one helped you out! :-)
@haripriyaraja1890
@haripriyaraja1890 Год назад
Thank you so much
@PortfolioCourses
@PortfolioCourses Год назад
You’re very welcome Haripriya! :-)
@mjsaedy6637
@mjsaedy6637 11 месяцев назад
"go through the functions one at a time" Pun intended?
@johnpipe362
@johnpipe362 2 года назад
Very Helpful.
@PortfolioCourses
@PortfolioCourses 2 года назад
I’m glad to hear it helped you out John! :-)
@trikkee
@trikkee Год назад
How about the theory of the relativity where time count down slowly ? Thank you for sharing.
@PortfolioCourses
@PortfolioCourses Год назад
Hahaha someone should make that library. :-) You’re welcome!
@hilacohen230
@hilacohen230 2 года назад
Thanks for straightforward explanation ! Is there a way to see the current time (since EPOCH) in milliseconds?
@PortfolioCourses
@PortfolioCourses 2 года назад
I actually didn't know the answer to this myself, so I had to Google it, and this Stackoverflow thread offers a couple solutions... a possible function use and a POSIX library function that can be used: stackoverflow.com/questions/1952290/how-can-i-get-utctime-in-millisecond-since-january-1-1970-in-c-language. So I would try our these methods. I think maybe I'll make a video on this someday. :-)
@Ahmadkhan-sm2qd
@Ahmadkhan-sm2qd 4 месяца назад
For milliseconds, you can use chrono C++
@radio_electronics4047
@radio_electronics4047 Год назад
sleep(2) does not work for me. It creates an endless loop... Edit: Ok, the problem was that I didn't put a at the end of a printf statement, and C somehow cant write into the same line again, when there was a sleep in between.
@PortfolioCourses
@PortfolioCourses Год назад
I'm glad you figured it out! :-)
@junpuyinwei4020
@junpuyinwei4020 Год назад
谢谢!😜
@PortfolioCourses
@PortfolioCourses Год назад
You’re welcome! :-)
@ismailchiba7002
@ismailchiba7002 Год назад
i have a question what does seed mean like when we want to use the srand fuction : srand(time(0))
@PortfolioCourses
@PortfolioCourses Год назад
We seed the random number generator to ensure that it gives us different random numbers each time we run the program. We typically seed it with a value that will be unique each time we run our program, like for example the current time. This video on random number generation explains more: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Mp3eGLX-OpY.html. :-)
@ismailchiba7002
@ismailchiba7002 Год назад
@@PortfolioCourses thanks 😁
@PortfolioCourses
@PortfolioCourses Год назад
@@ismailchiba7002 You're welcome! 🙂
@printdaniel
@printdaniel 2 года назад
Thanks you!!!.
@PortfolioCourses
@PortfolioCourses 2 года назад
You're welcome Daniel! 😀
@gurmukhsingh8190
@gurmukhsingh8190 Год назад
Hi I tried the code from this video in the Arduino IDE. I want to show the current time and date. However, the output is showing the time and date from January 1970. Any ideas on how I can fix this code? void loop() { time_t now = time(NULL); char *string_now = ctime(&now); Serial.println(string_now); }
@PortfolioCourses
@PortfolioCourses Год назад
Great question Gurmukh! 🙂 I'm not sure exactly how the time.h library will work with Arduino and the Ardunio IDE, or whether it will work at all. There is this other time library for Arduion that people seem to mention online, maybe this would be better to use instead of time.h: github.com/PaulStoffregen/Time.
@gurmukhsingh8190
@gurmukhsingh8190 Год назад
@@PortfolioCourses Thank you so much for the quick response. The time libraries from this link that you have provided look useful I will check them out. Thank you so much you for all your help! 🙂
@PortfolioCourses
@PortfolioCourses Год назад
@@gurmukhsingh8190 You're welcome! 🙂
@maurod6180
@maurod6180 Год назад
great
@PortfolioCourses
@PortfolioCourses Год назад
Thank you Mauro! :-)
@GeeKay870
@GeeKay870 4 месяца назад
Tyy
@PortfolioCourses
@PortfolioCourses 4 месяца назад
You’re welcome! :-)
@tdoc666___
@tdoc666___ 7 месяцев назад
this topic took a long *time* to explain, what a bad joke...
@Bruh-nj3bv
@Bruh-nj3bv 2 года назад
2 secs 😈
@PortfolioCourses
@PortfolioCourses 2 года назад
2 secs? :-)
@handsomeman-pm9vy
@handsomeman-pm9vy Год назад
WTF? How many libraries are needed for a simple program? C sucks!
@PortfolioCourses
@PortfolioCourses Год назад
Hahahaha I hear you… C is sort of the “grandpa” of programming languages, it’s old and does things in old ways and needs some extra help to get around. :-)
@miguelcosta4450
@miguelcosta4450 Год назад
Portfolio can you help me? You have discord?
@PortfolioCourses
@PortfolioCourses Год назад
I do not have a discord and I am not able to provide tutoring right now due to time constraints, but I do try to answer questions that are posted as comments on videos. :-)
Далее
struct Basics | C Programming Tutorial
24:44
Просмотров 137 тыс.
Самое неинтересное видео
00:32
Просмотров 1,2 млн
why do header files even exist?
10:53
Просмотров 401 тыс.
Why More People Dont Use Linux
18:51
Просмотров 182 тыс.
Master Pointers in C:  10X Your C Coding!
14:12
Просмотров 304 тыс.
How computer processors run conditions and loops
17:03
Premature Optimization
12:39
Просмотров 803 тыс.
size_t Type | C Programming Tutorial
7:17
Просмотров 12 тыс.
why do void* pointers even exist?
8:17
Просмотров 359 тыс.