Replies: 11 comments 1 reply
-
@jottinger I do not have a Mac to test with. Since the OS is based on BSD I guessed that the UNIX delay would work. In udelay the compiler is instructed to use udelay for linux and darwin. Can you clone and run the below build and test? I would greatly appreciate it. I am assuming that you want to help. :)
|
Beta Was this translation helpful? Give feedback.
-
With the change from this PR, that call works and it compiles. I have not tried it on Linux; I have a FEELING that the same code might work for Windows, too. |
Beta Was this translation helpful? Give feedback.
-
This is the testing code I wrote when I noticed that the delay was not what I expected.
|
Beta Was this translation helpful? Give feedback.
-
@jottinger do you have a development environment that you can work in? It would be nice if we could work together on this. |
Beta Was this translation helpful? Give feedback.
-
Yeah, but note that I'm a go newbie myself. My help's not going to be as
useful as one might hope, I fear.
And as far as sleep is concerned... sleep AT LEAST n is pretty much what
you want, in most cases, unless you're talking realtime responsiveness. And
for this... I'm not thinking the granularity is as important as it might
seem.
…On Tue, Oct 12, 2021 at 4:28 PM Bill Jones ***@***.***> wrote:
@jottinger <https://github.com/jottinger> do you have a development
environment that you can work in? It would be nice if we could work
together on this.
You can create a new branch off of the working-branch and make a
mdelay.go and Delay() function.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADSNGQLKBY7KBE6UAMSCRLUGSK7RANCNFSM5F2UJCQQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Joseph B. Ottinger
http://www.enigmastation.com <http://enigmastation.com>
*To the beautiful and the wise,*
* The mirror always lies.*
|
Beta Was this translation helpful? Give feedback.
-
Since it has to be accurate I know it sounds counterintuitive, but a close look at the Go code base shows that it is "at least" and that "at least" can vary wildly. Try the program above, I would be interested in its output on your Mac AND yes you can be very useful. Questions make people think and you have a Mac :) !!! |
Beta Was this translation helpful? Give feedback.
-
On my mac, I get this output:
On my Linux server, this is my output:
What output do you get on your various platforms? This shows a consistent granularity on both OSX and Linux; I can't speak for Windows, but for a game like this, I am not thinking the granularity showed here is statistically significant as a negative, compared to the advantage in simplicity. (I ran the competition on OSX, with my timer code, for example, and it ran fine; a little quickly, really, but eh, whatever.) |
Beta Was this translation helpful? Give feedback.
-
On the M1, I get slightly different performance:
(I am still running the rest of the app, it just is being consistent with the numbers and it takes a while to run, obviously.) In all cases, the performance of |
Beta Was this translation helpful? Give feedback.
-
okay, little changes to the timing testg to show some of the deltas and FPS. Keep in mind the FPS is a perfect world. It doesn't take into account the actual delay due to the interpreter running on X number of robots. Here is the changed code. My results will be in the next post.
|
Beta Was this translation helpful? Give feedback.
-
Can you try this code? I am going to add a darwin delay file for a test but also add a flag for a timing test. Maybe it can help in the long run. If you are helping in the docs (please please) make sure you are pulling from "working-branch". Windows AMD 3.2ghz (not the best...) You can see Windows is terrible!!! 10us give 14ms, this is when I learned through testing the best windows will do is 12ms.
Linux Intel Core5 2.4ghz
Linux Intel Core7 laptop
|
Beta Was this translation helpful? Give feedback.
-
@jottinger Mad did I find some major screw ups. My end detection code was messed up. Jeeeze the stuff you miss.... |
Beta Was this translation helpful? Give feedback.
-
There's presently a barrier with syscall.Nanosleep() in delay/udelay.go; this is likely to be something appropriate for Linux and Windows but not OSX.
Beta Was this translation helpful? Give feedback.
All reactions