Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / System up time

Author
Message
MMQ
17
Years of Service
User Offline
Joined: 12th Aug 2006
Playing:
Posted: 15th Feb 2020 15:23
Though strictly speaking not game-related, in DBP I wrote a function using timer() that displayed how long the PC had been switched on for.
In AGKS timer() gets the number of seconds since the app was started.
I am wondering if there are any commands in AGKS that query the system up time, as opposed to the current time via GetCurrentTime()?

Thanks in advance.
Madmaxquinn

There are only 10 types of people in the world: those who understand binary and those who don\'t.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 15th Feb 2020 17:02
think you mean GetMilliseconds()
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
MMQ
17
Years of Service
User Offline
Joined: 12th Aug 2006
Playing:
Posted: 15th Feb 2020 23:48
GetMilliseconds() gets the number of milliseconds since the app was started. Unfortunately this is not what I'm looking for. I'm looking for a call to the OS to return the lapsed time since the device/OS was initialised. It's quite possible that is this capability is missing in AppGameKit, which would be a shame since DBP gave you a means to get that information.

Thanks.
Madmaxquinn

There are only 10 types of people in the world: those who understand binary and those who don't.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 16th Feb 2020 10:59
ah yes i completely misread that, i don't think it's possible currently
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Bored of the Rings
User Banned
Posted: 16th Feb 2020 11:13
port over the dbpro dll that has the command you want.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 18th Feb 2020 12:49
The reason that Dark BASIC Professional (and Dark BASIC) both had a Timer Call based upon System Uptime (i.e. from when the OS was last booted) is because that's how Windows itself handles the System Timer.

This isn't actually how most Modern OS work... as I recall there is no way (without creating a Service Runtime to track it) to find out the current "Uptime" of most OS.
It's typically not even useful info to know.

As consider that with System Time from Boot., it's entirely possible to easily hit the "Maximum" of the 32bit Value.
I mean it resets every ~1,193hrs (49 Days 17 Hrs) ... which given that most people put their Computers into "Sleep" or "Hibernation" Mode instead of actually turning them Off., means that should you track this information; likelihood of actually hitting the "Maximum" is higher than you might think; which for Applications that don't account for this, means you're going to get some interesting "Quirks" occur at said point.

Conversely speaking however., you're VERY unlikely to hit this for when an Individual Application is being run; as you're typically not always going to have them Open / Running.
So it's better to have a "New" Timer specifically for the Application.



Actually, what I find weird is that AppGameKit still uses a Single Application Timer... rather providing a Timer Framework that allows you to create Multiple Timers.
I mean I've done that myself:



But, yeah... interesting how such an approach isn't "Built-In"
Mind... I've always been curious as to why "True" and "False" aren't Default Values as they are in most other Languages.



Now assuming that you don't actually want to create a Plug-In... provided you're on Windows, you can do this:



Now as a note... I don't get along with the File Commands in AGK.
No idea WTF I'm doing wrong with them., but regardless... the file does exist; and if you follow the filepath in the app you can verify it's existence and that it's just a standard text file.
Why AppGameKit doesn't believe that - frankly I gave up trying to figure out.

Still it should provide you with what you want.

Login to post a reply

Server time is: 2024-04-26 20:02:30
Your offset time is: 2024-04-26 20:02:30