Skip to content

dry29.c gives the wrong number on macOS #4

Description

@chris0e3

On macOS ticks per second is 100.
However, dry29.c uses 60. (Through dry.c uses 100.)

dry29.c line: 43

#define HZ 60   /* 2.9BSD standard: 60 Hz (1/60 second ticks) */

This may explain the surprisingly low number (47,808,764) you reported for a Mac M2 Ultra.
While I get 61,300,308 with a much older i7 Macmini using dry.c.

The following works for me, though I don’t know how portable it is.

#include <limits.h>
#define HZ CLK_TCK

Also the output line Microseconds for one run through Dhrystone: 0.0 would be better updated to use Nanoseconds….

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions