Tyson
Member
I'm trying to learn to code, but I really have no background. So I was hoping I could get some help.
Is there a way to write code in C++ such that you can get your code to perform a certain action at a certain time?
I'm currently doing this by using <time.h> and <sys/time.h> and there's a time(null) function that will return the current time. So the way I'm kind of doing it is like...
while( time(null) < someTime) {
do stuff
}
and then stuff happens at someTime.
But this requires my code to call the time(null) function over and over and over again, and I'd prefer not to do that. Is there functionality in C++ so that I could have something along the lines of:
At 3:30pm, std::cout << "Tyson sucks at coding" << std::endl;
And be able to do this without having my code keep asking what time it is.
Thanks in advance. If anyone is interested in the field of high-frequency trading, I'd be happy to have a conversation. There are always tons of opportunities for developers. Yeah, I'm not much of a coder so I can't really contribute there, but if any coders want to learn about trading, that's how I can reciprocate.
Is there a way to write code in C++ such that you can get your code to perform a certain action at a certain time?
I'm currently doing this by using <time.h> and <sys/time.h> and there's a time(null) function that will return the current time. So the way I'm kind of doing it is like...
while( time(null) < someTime) {
do stuff
}
and then stuff happens at someTime.
But this requires my code to call the time(null) function over and over and over again, and I'd prefer not to do that. Is there functionality in C++ so that I could have something along the lines of:
At 3:30pm, std::cout << "Tyson sucks at coding" << std::endl;
And be able to do this without having my code keep asking what time it is.
Thanks in advance. If anyone is interested in the field of high-frequency trading, I'd be happy to have a conversation. There are always tons of opportunities for developers. Yeah, I'm not much of a coder so I can't really contribute there, but if any coders want to learn about trading, that's how I can reciprocate.