Browse Search Popular Register Upload Rules User list Login:
A Better Timebase

screenshot of the scene

Author: Xray

Group: Default

Filesize: 28.88 kB

Date added: 2016-01-02

Rating: 5

Downloads: 298

Views: 270

Comments: 28

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0


Scene tag

For those of you who write thyme script, I offer you a more stable timebase than sim.time. It is based on the computer hardware system clock rather than the Algodoo software clock which is prone to lag in time as the scene lags.

The only negative that I know of for using system.time is that you will have to add little bit of extra script in order to normalize the readout for your particular scene. (i.e.: hours, minutes, seconds or whatever)

Please let me know what you think of this idea (negative or positive).


Last edited at 2016/01/02 06:13:21 by Xray
Please log in to rate this scene
Similar scenes
Title: Input X vs Y Oscilloscope Trace
Rating: 6.7273
Filesize: 391.47 kB
Downloads: 2563
Comments: 18
Ratings: 5
Date added: 2019/09/02 06:57:23
Made with: Algodoo v2.1.0
Rating: rated 6.7
N Or P? i choose P because the system time goes actual time but the sim time goes normally but it lags and slows down so its hard for it to catch up. i think system.time is a better choice and possibly remove sim.time unless people really need it
Witherskull4091 - Thanks for the comment, but I looked back through most of your scenes, and you haven't written even a single line of Thyme script. So, what makes you an authority on the subject? I'm not being sarcastic. Just wondering.

Thanks again.
How do I delete the boxes and sim.time?
Wow, That's Cool Xray. How You Make This?
Lol. xD
And I Choose N For A Negitive is some cool
And The System is negitive
@Aaron8205 -- Delete the boxes and sim.time? Why on God's green earth would you want to do that? It has nothing to do with what I am demonstrating in the scene. Do you even understand Thyme scripting? )|(

hugh -- Sorry but I don't understand your comments. And just like Aaron8205 I don't think you understand what this scene is about. If you don't know Thyme scripting, then you shouldn't even comment about this because you give me no useful information.
Guys, only comment if you understand thyme, if you ask how he does this it means you don't have a clue how thyme works, so don't bother unless you decide to leave behind camps and instead start using thyme.
Nice scene. The only time I would use the system clock is is if I were to make a real clock in Algodoo. Other than that, system time has no meaning in Algodoo.
@s_noonan - Thanks for your comment, but please elaborate what you mean by "system time has no meaning in Algodoo"? FYI - I have not only used it for displaying time clocks for some of my game scenes, but I have also used it for timing events, and it worked very well for those instances. You may very well be correct, but I need to understand in more detail what your thoughts are about it.

Thanks again!
Oh and by the way about that scene it was meant for ObjectShowLover It was just a Typo I thought the name was ultra's for a sec I SWEAR IT WAS A MISTAKE

Heh my apoligizes for the inconveince
Xray i made a deleting scene for you to read.
that is how you private message right?
Well, the best way to send a "Private Message" is through the FORUM. Just click on "forum" above, then log-in with your forum user name (can be same or different than Algobox user name). Then go to "Control Panel" and click on "Private Message" tab. The nice thing about that is the messages are truly private. But if you create a scene and then delete it, yes, I could still see it because I can see deleted scenes, but so can other admins! So, if you have something that you want only me to read, then it's best to go through the forum Private Message system.

Oh, one more thing.... Yes, you can send a message to an Admin by making a text scene and then deleting it, but you cannot send a "private message" that way to any other (non-admin) user. So, it really is better to use the forum for sending messages to other people.
Last edited at 2016/01/02 21:09:11 by Xray
@Nickelfan - NP! Mistakes sometimes happen (that's why they put erasers on the ends of pencils!:lol: )
So, is there really any advantage to using sim.time over system.time, ever? because sim.time seems to just get punched in the face when there are a lot of objects, even on high-end hardware (i7 cpu and modern nvidia gpu)
What I'm trying to say is, I want to keep the boxes in Algodoo, but how do you get to system.time??:| |:(
Aaron8205 - I don't think you know what you want! First you stated that you wanted to delete the boxes, and now you say that you want to keep the boxes! :s )|(

You apparently are not serious about learning Thyme script because of the confusing and meaningless questions that you ask. My suggestion for you is to log-in to the Algodoo forum and start reading through the forum section titled "Thyme Scripting". There is a lot there, but you need to start with the basics. If you have specific questions, it's best to ask them in the forum, and not here in the scene comments.
Last edited at 2016/01/04 01:59:45 by Xray
I agree with s_noonan, system time has no meaning in algodoo.
For example, if I want to calculate the average speed of a car.
I use the time at the beginning of the track and at the end of the track. If algodoo lags and I use system.time the result will be different, even though the car didn't drive slower or faster. The results will also be different when I increase or decrease the simulationspeed. But if I use sim.time the result will always be the correct.
Last edited at 2016/01/04 21:40:39 by T'wind
I kind of understand scripting... like only "time to live" and I use it everywhere I go. If thyme is similar to computer coding and scripting, then maybe I could get somewhere...
T'Wind - When s_noonan made his comment, "...system time has no meaning in Algodoo", I was puzzled by it because I didn't understand what be meant by that. But after thinking more about it and after playing around with both timebases some more, I think I understand what he meant by it.

I call sim.time "Algodoo Time" and I call system.time "Real World Time". You are right about the fact that as a scene begins to lag, then sim.time will also begin to lag, and therefore, sim.time is accurate within the Algodoo simulated world. But, as s_noonan stated, if you want an accurate real-time clock (i.e., accurate to the real world) then you would need to use system.time. So, which timebase you use in a scene will depend on the application, and in some scenes, you may need to use both of them, each for a different purpose.

One interesting fact that I only recently discovered is that system.time begins counting from zero as soon as Algodoo gets launched. The sim doesn't need to be running -- only the program launched. Sim.time is different. It starts running from zero the first time when the simulation is started, and only runs while the simulation is running. Sim.time is also affected by "redo" and "undo" -- System.time is not.
Maybe you should change the title to "Another Timebase". Because it depends on the situation which one is better.
Xray, thanks, I'm gonna try doing the sine, cosine, and tangent with one with it based on sim.time, the other on system.time.
Sorry, kilinich. I don't allow profanity in comments, even if you attempt to hide it by substituting other letters.

Yes, system.time does run while sim is paused, but there are ways to compensate for that.
Instead of using system.time and compensate it, you can just use sim.time.
Negative. Imagine a scene with a car where you have to complete the track in shortest time you can. Then people with faster PCs would always win, cause the car will go faster, but the timer will not.