Raised This Month: $12 Target: $400
 3% 

GetSysTickCount() overflow (-2147483648)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 19:24   GetSysTickCount() overflow (-2147483648)
Reply With Quote #1

Hi!

GetSysTickCount() returns -2147483648.

According to GetTickCount WinAPI (not sure, how far it's suitable for linux) it can measure system uptime up to 49.7 days.

Is there GetTickCount64() analogue in SourceMod and appropriate variable type to hold ULONGLONG ?

Thanks,
Alex.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-22-2018 at 19:24.
Dragokas is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 05-22-2018 , 19:37   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #2

GetTime()
Quote:
int[2] bigStamp
Optional array to store the 64bit timestamp in.
Is this what you are looking for? The ULONGULONG would be a an int array.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 19:39   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #3

I interested in uptime.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 05-22-2018 , 19:44   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #4

Wouldn't system time be equal to "uptime" in this case?
Quote:
Gets the system time as a unix timestamp.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 19:47   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #5

No, it will not.

It's a system time (date) in unix format.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 05-22-2018 , 20:38   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #6

Awh yeah that's right. I've used this before and didn't even remember. There may not be a 64 bit version of the GetTickCount function in sm but you can always write an extension to relay the data.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 05-23-2018 , 08:13   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #7

You should just restart your server every night. The engine itself will become out of sync with high tickcount values due to increasing floating point errors which will lead to all kind of problems.
__________________
Peace-Maker is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-23-2018 , 09:09   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #8

Peace-Maker, it looks like this is not KVM, or something that server restart is not affect on.
Restarting is already planned in scheduler every day.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 05-23-2018 , 10:28   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #9

Oh, misread that with GetEngineTime. What do you need GetSysTickCount for? Use the profiling API for profiling. https://sm.alliedmods.net/new-api/profiler
__________________
Peace-Maker is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-23-2018 , 10:39   Re: GetSysTickCount() overflow (-2147483648)
Reply With Quote #10

Quote:
What do you need GetSysTickCount for?
In fact, to make someone a brain no offense
I think if function exist, it should work reliable in any conditions.
Previously, I used it for something like profiling.

And now, I switched to GetTime() and to Profiling API, as you suggested for more accurate measurements. Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-23-2018 at 10:39.
Dragokas is offline
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

Forum Jump


All times are GMT -4. The time now is 10:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode