On 5/31/21 5:20 PM, data pulverizer wrote:
On Monday, 31 May 2021 at 21:01:19 UTC, Steven Schveighoffer wrote:

ticksPerSecond is initialized in the runtime just before static constructors are run. See https://github.com/dlang/druntime/blob/2d8b28da39e8bc3bc3172c69bb96c35d77f40d2a/src/rt/dmain2.d#L130

Are you calling Runtime.initialize()?


Nope, I guess I'm supposed to be? if so where do I place the call(s) for initialize() and terminate()?



You need to call it wherever you think it might not have been called yet.

It's reentrant, so if you call it more than once, it will only initialize once, and count how many times you have to call `Runtime.terminate`.

Best to use a `scope(exit)` to call `Runtime.terminate` if you are calling it periodically.

-Steve
  • How to compile Phobos with ot... data pulverizer via Digitalmars-d-learn
    • Re: How to compile Phobo... kinke via Digitalmars-d-learn
      • Re: How to compile P... data pulverizer via Digitalmars-d-learn
        • Re: How to compi... Steven Schveighoffer via Digitalmars-d-learn
          • Re: How to c... data pulverizer via Digitalmars-d-learn
            • Re: How... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... data pulverizer via Digitalmars-d-learn
                • ... Adam D. Ruppe via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... data pulverizer via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... data pulverizer via Digitalmars-d-learn
                • ... bachmeier via Digitalmars-d-learn
                • ... data pulverizer via Digitalmars-d-learn
                • ... bachmeier via Digitalmars-d-learn
                • ... Alain De Vos via Digitalmars-d-learn

Reply via email to