The code now waits for 1 second (1000 milliseconds) using Wait(1000). This reduces the number of iterations in the loop and makes the code more efficient.
Instead of using *os.time(os.date("!t")) to calculate the current time, we can directly use os.time()**.
Instead of dividing os.time() by 2 and adding 360 to get newBaseTime, we divide it by 2 and add 180. This achieves the same effect since os.time() returns the number of seconds elapsed since January 1, 1970.
We update the previous variable with the current seconds (os.date("%S")) to track the change in seconds.
These optimizations make the code more streamlined and efficient while achieving the same functionality.
Questions (please complete the following information):
Have you personally loaded this code into an updated qbcore project and checked all it's functionality? [YES]
Does your code fit the style guidelines? [YES]
Does your PR fit the contribution guidelines? [YES]
Describe Pull request
The code now waits for 1 second (1000 milliseconds) using Wait(1000). This reduces the number of iterations in the loop and makes the code more efficient.
Instead of using *os.time(os.date("!t")) to calculate the current time, we can directly use os.time()**.
Instead of dividing os.time() by 2 and adding 360 to get newBaseTime, we divide it by 2 and add 180. This achieves the same effect since os.time() returns the number of seconds elapsed since January 1, 1970.
We update the previous variable with the current seconds (os.date("%S")) to track the change in seconds.
These optimizations make the code more streamlined and efficient while achieving the same functionality.
Questions (please complete the following information):