On Wed, Jan 16, 2019 at 11:55 AM Wojciech S. Czarnecki
wrote:
> You can't expect a million interrupts per second and host OS running
> simultaneously.
> (1us gives some 4k instructions inbetween on recent 3GHz cpu core)
>
>
And to add: if you do anything with memory, it is usually considerably
On Mon, 14 Jan 2019 21:34:34 +0100
Tamás Király wrote:
> I'm simulating the internal clock of an embedded microcontroller...
You can't expect a million interrupts per second and host OS running
simultaneously.
(1us gives some 4k instructions inbetween on recent 3GHz cpu core)
Usual way for
Not sure what your need is, but maybe you need time.Since instead of saving the
start time and substracting it from time.Now.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send
thanks for the suggestions and notes, i threw out the loop, save the start
timestamp and call time.Now()-start when i need the value which is in the
second range.
- Tamás
David Anderson ezt írta (időpont: 2019. jan. 14., H,
21:54):
> Note that even for a state of the art CPU, there's only a
Note that even for a state of the art CPU, there's only a few thousand
instructions in a microsecond (1000 cycles per microsecond per GHz). At
that kind of performance, anything you do that involves the OS or
context-switching will make it impossible to hit your target refresh rate.
The closest
If you are going to use time.Now() and a ‘change loop’, you should probably
lock the thread to the Go routine to avoid an scheduler thrashing.
> On Jan 14, 2019, at 2:34 PM, Tamás Király wrote:
>
> I'm simulating the internal clock of an embedded microcontroller... And this
> sentence (and
I'm simulating the internal clock of an embedded microcontroller... And
this sentence (and you!) gave the idea to use time.Now().
Thanks!
Tamas
9. jan. 14., H 21:12 dátummal Matt Ho ezt írta:
> Can you describe what task it is that needs to be updated every
> microsecond? It seems like there
Can you describe what task it is that needs to be updated every
microsecond? It seems like there should be a better to resolve the
underlying need.
M
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
I updated the github issue with some additional performance comparisons and
notes.
I think there are some pretty trivial solutions for high frequency pollers, at
least those using time.Sleep()
> On Dec 19, 2018, at 10:03 PM, Robert Engels wrote:
>
> Then something is broken on the
Isn’t doesn’t even need to be that complex, the following uses 1.25 cores at
100% on my machine:
package main
import "time"
func main() {
counter := 0
for {
counter++
time.Sleep(time.Microsecond)
}
}
even if you change it to 100 usecs, which is only 10,000 times a second,
On Wed, Dec 19, 2018 at 1:29 PM Tamás Király wrote:
>
> my task is to update a value every microsecond.
> i did an it with an infinite loop with time.Sleep like this
>
> https://play.golang.org/p/JiN3_5KiGOO
>
> this causes me about 50-60% of CPU usage on my machine but i made another
> version
hi!
my task is to update a value every microsecond.
i did an it with an infinite loop with *time.Sleep* like this
https://play.golang.org/p/JiN3_5KiGOO
this causes me about 50-60% of CPU usage on my machine but i made another
version with *time.After*:
https://play.golang.org/p/PQHsNq261qZ
12 matches
Mail list logo