SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/09/2018, 02:25 PM   #1
v1k1nG
Huge Clucker
 
v1k1nG's Avatar
 
Join Date: Feb 2018
Posts: 373
Reputation: 25
Default tickcount() overflow question

https://wiki.sa-mp.com/wiki/Tickcount
"this count overflows after approximately 24 days of continuous operation"

Does this mean I have to reset tickcount's variable value before 24 days?
v1k1nG is offline   Reply With Quote
Old 26/09/2018, 02:38 PM   #2
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,215
Reputation: 3180
Default Re: tickcount() overflow question

No. This is only a problem if you COMPARE times over 24 days. So if you do:

`if (time1 > time2)`

And there was more than 24 days between the two times it might be wrong. Also, given the wrap-around, the correct way to compare the times is:

`if (time1 - time2 > 0)`
Y_Less is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] GetTickCount e tickcount minimessi10 Português/Portuguese 3 21/04/2015 09:30 PM
tickcount() problem Sarra Scripting Help 1 18/08/2014 07:43 PM
tickcount alternatives hbzi Scripting Help 5 18/06/2013 07:26 PM
GetTickCount or tickcount? Miguel Help Archive 4 12/10/2010 12:35 AM
TickCount Riaz Русский/Russian 18 02/04/2010 05:21 PM


All times are GMT. The time now is 12:50 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.