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 <d...@natulte.net> ezt írta (időpont: 2019. jan. 14., H, 21:54): > 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 you can get is to lock the goroutine to an OS thread and do > busy waiting (and that still won't save you from OS preemption, unless > you're doing something explicit about that too). > > - Dave > > On Mon, Jan 14, 2019 at 12:35 PM Tamás Király <rock8...@gmail.com> wrote: > >> 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 <matt...@gmail.com> ezt írta: >> >>> 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 receiving emails from it, send >>> an email to golang-nuts+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> 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 an >> email to golang-nuts+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- 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 an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.