Discuss Scratch
- Charles12310
-
1000+ posts
Current millisecond
Hmm, semi-support, since a millisecond is 1/1000 of a second, and you could just do:
It isn't.
Exactly, if we can't have millisecond, why do we have the other time?
If we can't have the “previous costume” block, because it can be easily replicated, why do we have the “next costume” block, which is also easily replicated? See what I mean?
wait ((0.001) * (amount you want)) secs
This is not exact. Due to a short wait in the variable block, the timer will be different than the actual timer, it is not 100% reliable to use. Many people think that this is a workaround for timers:You can't wait for 0.001 seconds. Lowest is 0.03333333333… seconds. Does it?foreverIs that milliseconds? It should be, right, it's 1 thousandth of a second?
wait (0.001) secs
change [timer v] by (0.001)
end
when green flag clicked
set [timer v] to [0]
forever
wait (0.1) secs
change [timer v] by (0.1)
end
It isn't.
That wouldn't work. That's just dividing the second (a whole number) by 1000. No support.((current [second v]) / (1000))
_system's millisecond time?The let's remove Why would you need to measure the
No support.(current [ v])because what's the point of measuring the system's second, or minute, or hour?
_
Support; even though the workaround can be figured out after some time, it would be nice to have a millisecond block that does not lag (the timer, if I'm correct, is based on FPS, so it varies among users. The days since 2000 block and current block is based on real time, so it goes at a constant rate)
Exactly, if we can't have millisecond, why do we have the other time?
If we can't have the “previous costume” block, because it can be easily replicated, why do we have the “next costume” block, which is also easily replicated? See what I mean?
- DaEpikDude
-
1000+ posts
Current millisecond
What exactly does this do as a workaround? I'm not sure how this workarounds finding the current millisecond. Hmm, semi-support, since a millisecond is 1/1000 of a second, and you could just do:wait ((0.001) * (amount you want)) secs
Because the other times are generally more used than milliseconds, and we have the timer for milliseconds?-snip-
Exactly, if we can't have millisecond, why do we have the other time?
Hoo boy, the workaround discussion again. If we can't have the “previous costume” block, because it can be easily replicated, why do we have the “next costume” block, which is also easily replicated? See what I mean?
In relation to that specific case, in animations and such you're vastly more likely to be moving forwards through frames than moving backwards.
Anyway, in relation to the OP, there isn't much reason to not adding this.
However…
Semi-support. if you think about it the(timer)has to run with the fps of the your computer so and most of the time the fps of computers is 30 or 60 so
how could it show a 1000 of a second if it can only run at 1 frame every 30 or 60 seconds?
- Charles12310
-
1000+ posts
Current millisecond
1. Isn't a millisecond 0.001 of a second? Mis-read OP, but I'm sure it could be replicated with:What exactly does this do as a workaround? I'm not sure how this workarounds finding the current millisecond. Hmm, semi-support, since a millisecond is 1/1000 of a second, and you could just do:wait ((0.001) * (amount you want)) secsBecause the other times are generally more used than milliseconds, and we have the timer for milliseconds?-snip-
Exactly, if we can't have millisecond, why do we have the other time?Hoo boy, the workaround discussion again. If we can't have the “previous costume” block, because it can be easily replicated, why do we have the “next costume” block, which is also easily replicated? See what I mean?
In relation to that specific case, in animations and such you're vastly more likely to be moving forwards through frames than moving backwards.
Anyway, in relation to the OP, there isn't much reason to not adding this.
However…Semi-support. if you think about it the(timer)has to run with the fps of the your computer so and most of the time the fps of computers is 30 or 60 so
how could it show a 1000 of a second if it can only run at 1 frame every 30 or 60 seconds?
((current [second v]) * (0.001))2. Well, we would never know what it could be used unless it came! I mean, I wouldn't have to have to keep on putting zeros and decimal points on a wait, neither would I have no wait block because then events would happen to quickly, but I don't want them to happen slowly do I? In fact, this might not be enough for me:
wait (0.1) secs3. I mean, sure, but sometimes there might be slides of switching back and forth. And there is a previous backdrop block, but it's in the switch backdrop to block, including the next backdrop block, even though another block exists, which confuses me.
4. Exactly.
- FancyFoxy
-
500+ posts
Current millisecond
…how? This Seems A Bit Too Complicated For Scratch.
- DisasterPug
-
100+ posts
Current millisecond
So we should remove This Seems A Bit Too Complicated For Scratch.
([ v] of (9) :: operatorsbecause it's too complicated?
Last edited by DisasterPug (Oct. 1, 2017 17:42:14)
- walkcycle
-
500+ posts
Current millisecond
A round
works for milliseconds.
And the math operators are more useful than a millisecond reporter, imo.
( letter (5) of ( join ( (timer) - ( [floor v] of (timer) ) ) [ ] ) ) // use in a "run without screen refresh" block
works for milliseconds.
The standard for adding something to Scratch is different from the standard for removing something from Scratch. So we should remove([ v] of (9) :: operatorsbecause it's too complicated?
And the math operators are more useful than a millisecond reporter, imo.
Last edited by walkcycle (Oct. 2, 2017 16:09:07)
- kenny2scratch
-
500+ posts
Current millisecond
define get current millisecondEnjoy!
set [current millisecond v] to ((((days since 2000) * (86400)) - ([floor v] of ((days since 2000) * (86400)))) * (1000))
- walkcycle
-
500+ posts
Current millisecond
^ For those wondering, the 86400 number is the seconds in a day.
So,
is the seconds since 2000.
Then subtracting the floor gets the current fraction of a second.
And multiplying by 1000 gets the deci-, centi-, and milli- seconds in front of the decimal mark.
And our thread is was a duplicate. It got combined.
((24) * ((60) * (60))) // (24 hours in a day) * (60 minutes in an hour) * (60 seconds in a minute)
So,
((days since 2000) * (86400)) // (days since 2000) * (seconds in a day)
is the seconds since 2000.
Then subtracting the floor gets the current fraction of a second.
And multiplying by 1000 gets the deci-, centi-, and milli- seconds in front of the decimal mark.
And our thread is was a duplicate. It got combined.
Last edited by walkcycle (Oct. 2, 2017 22:26:05)
- Charles12310
-
1000+ posts
Current millisecond
All you are doing is just linking to the front page of this topic. ^ For those wondering, the 86400 number is the seconds in a day.((24) * ((60) * (60))) // (24 hours in a day) * (60 minutes in an hour) * (60 seconds in a minute)
So,((days since 2000) * (86400)) // (days since 2000) * (seconds in a day)
is the seconds since 2000.
Then subtracting the floor gets the current fraction of a second.
And multiplying by 1000 gets the deci-, centi-, and milli- seconds in front of the decimal mark.
And our thread is was a duplicate. It got combined.
- walkcycle
-
500+ posts
Current millisecond
What about a
or
block? Then it would be easy to get the parts of a second on the clock.
(current [fraction of second v])
or
(current [subsecond v])
block? Then it would be easy to get the parts of a second on the clock.
- tazz4843
-
100+ posts
Current millisecond
Alright, this should be added to Scratch 3. Come on, ST!
- PrincessFlowerTV
-
1000+ posts
Current millisecond
Alright, this should be added to Scratch 3. Come on, ST!Necroposter!
JK, you can't necropost in suggestions.
No support- wouldn't be used a lot, and workaroundable.
- CCPlymJoe
-
100+ posts
Current millisecond
Workaroundable? How?Alright, this should be added to Scratch 3. Come on, ST!Necroposter!
JK, you can't necropost in suggestions.
No support- wouldn't be used a lot, and workaroundable.
- PrincessFlowerTV
-
1000+ posts
Current millisecond
Workaroundable? How?Alright, this should be added to Scratch 3. Come on, ST!Necroposter!
JK, you can't necropost in suggestions.
No support- wouldn't be used a lot, and workaroundable.
((0.001) * (amount you want))
- mystery4000
-
100+ posts
Current millisecond
Cant you just use timer blocks, I thought those went down a good amount of decimal places?
- CCPlymJoe
-
100+ posts
Current millisecond
Inaccurate.Workaroundable? How?Alright, this should be added to Scratch 3. Come on, ST!Necroposter!
JK, you can't necropost in suggestions.
No support- wouldn't be used a lot, and workaroundable.((0.001) * (amount you want))
- kenny2scratch
-
500+ posts
Current millisecond
Workaroundable? How?Alright, this should be added to Scratch 3. Come on, ST!Necroposter!
JK, you can't necropost in suggestions.
No support- wouldn't be used a lot, and workaroundable.
define get current millisecondEnjoy!
set [current millisecond v] to ((((days since 2000) * (86400)) - ([floor v] of ((days since 2000) * (86400)))) * (1000))