FAQ
I was having time resolution issues for a long time! Until I found your
example of Clock() fast and easy implementation.

Thank you very much!
On Tuesday, 28 August 2012 20:37:41 UTC+2, Maxim Khitrov wrote:

On Tue, Aug 28, 2012 at 1:06 PM, minux <minu...@gmail.com <javascript:>>
wrote:
On Wed, Aug 29, 2012 at 12:47 AM, Maxim Khitrov <m...@mxcrypt.com
<javascript:>> wrote:
I'm trying to time certain operations that cannot run within the
testing.Benchmark framework. It seems that unless the operation takes
at least 1 ms, the difference between two time.Now() calls is zero.
What is the source of timing information on Windows? I found the
implementations of runtime.now() for other platforms, but no idea what
Windows is using.
time.Now is implemented in
tip.golang.org/src/pkg/runtime/thread_windows.c#L214
using GetSystemTimeAsFileTime

Is there any way to access QueryPerformanceCounter and
QueryPerformanceFrequency functions? From some searching it looks like
these used to be available in the runtime package, but have since been
removed.
you can roll your own by using the syscall pkg.
Not even a hint? :)

Here's a working example for anyone else interested (won't run on the
play server, obviously): http://play.golang.org/p/Q2BbWz0sU1

- Max
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJul 31, '15 at 7:22p
activeJul 31, '15 at 7:22p
posts1
users1
websitegolang.org

1 user in discussion

Marcel Farrés Franch: 1 post

People

Translate

site design / logo © 2022 Grokbase