[Issue 335] New: incorrect std.c.time.CLK_TCK value (Linux)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 10 02:25:34 PDT 2006


http://d.puremagic.com/issues/show_bug.cgi?id=335

           Summary: incorrect std.c.time.CLK_TCK value (Linux)
           Product: D
           Version: 0.166
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


CLK_TCK's value is dependent on Linux's kernel configuration.

const clock_t CLK_TCK = 1000;

should be

/// The value for real clock ticks per second for the system.

version(Windows)

{

    const clock_t CLK_TCK = 1000;

}

else version (linux)

{

    const clock_t CLK_TCK = cast(clock_t) sysconf(2);

    private extern(C) int sysconf(int);

}

else

{

    static assert(0);

}


-- 




More information about the Digitalmars-d-bugs mailing list