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.

DarkBASIC Professional Discussion / Get TimeStamp without Matrix1

Author
Message
punkyb
2
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 16th Oct 2016 05:00
Hi I would like to poll the current timestamp but without the Matrix1 DLLs. Is it possible? How?

or maybe just convert the GET TIME$() function to timestamp?
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 16th Oct 2016 06:52
If your referring to the coordinated universal time (UTC), then try this.

punkyb
2
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 16th Oct 2016 07:37
Thanks WickedX! But how do I make it so it updates every second? Kind of like the timer function only I'm using the timestamp.

I would prefer without the hour:min:sec format because you can already do that with TIME$()

So I can read for example if 120 seconds has passed. BTW, I already solved my initial problem using time and mod function but this is just a simple workaround.



WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 16th Oct 2016 18:35 Edited at: 16th Oct 2016 18:36
I'm confused. Before I go and write some elaborate timing system, could you show some simple pseudo-code demonstration. Is there some particular reason you're not just using the timer or perftimer and perffrequency functions?
punkyb
2
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 16th Oct 2016 23:37
Ok thanks. Yes, I'm trying to run it under Wine (Linux 64bit) and for some reason the default timer function is messed up and throws negative 10 digit numbers. I also can't seem to run with Matrix1 plugins because it just crashes. The TIME$ still works ok so I got to used that.



Again it is for a specific use case, but running it on Windows works perfectly btw.
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 17th Oct 2016 00:42
Timer() returns a signed integer, you will get negative numbers when it wraps around after the system uptime reaches a certain point.

Matrix 1 often needs msvcp71.dll and msvcr71.dll in the application directory if you don't have the full redistributable installed to the system


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
punkyb
2
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 17th Oct 2016 02:36
Quote: "Timer() returns a signed integer, you will get negative numbers when it wraps around after the system uptime reaches a certain point.

Matrix 1 often needs msvcp71.dll and msvcr71.dll in the application directory if you don't have the full redistributable installed to the system
"


Thanks for the info. I tried Wine in Linux 32bit and used a window, the return is the same as expected. I don't know if it is a non gui version or the console only result. What I did is save the value in a text file to debug it.

As for the Matrix part, it also worked out of the box and no additional/files install when I tried running it in Linux with Desktop Environment. I'm trying to make it work on a console text app so probably I have missed something there.
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 17th Oct 2016 03:41 Edited at: 17th Oct 2016 04:05
So, you are saying this does not work under Wine?

punkyb
2
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 17th Oct 2016 04:27 Edited at: 17th Oct 2016 04:28
Quote: "So, you are saying this does not work under Wine?"


Yes, but on specific use case only which I'm trying to run it on a pure terminal and maybe it is dependent of a window? I have no idea. The TIME$ function works btw.

On a related question, can you do console/text application with darkbasic pro and without any plugins or extensions? I'm guessing it really needs a window which is completely understandable since it uses DX9 and focused on 2D/3D.
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 17th Oct 2016 16:09
Hmm, yeah it isn't really meant for pure console applications. It would not surprise me to find issues with this


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
punkyb
2
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 18th Oct 2016 02:00
Thanks, good thing this is the only issue I have found so far and TIME$ will just do!

Login to post a reply

Server time is: 2019-07-16 08:56:43
Your offset time is: 2019-07-16 08:56:43