3

I'm working on a project to modify the scheduler in MINIX 3. So to test it I need to analyse the wait time and turnaround time. To calculate the wait time I'm storing the system time when the process becomes ready initially (t1) and when the process is first alloted a time quantum (t2). So t2 - t1 gives the wait time.

But in MINIX I can't find a way to get precision better than time in seconds. I tired clock_gettime() function, returning time from the CLOCK_MONOTONIC clock but CLOCK_MONOTONIC doesn't exist in MINIX.

Also the shell command "date +%s%N" gives time in nanoseconds in linux but in MINIX "%N" option doesn't exist.

Is there a way to get the system time in milliseconds on better precision in Minix? Or is there another way to calculate wait time of processes without getting system time?

  • Minix is definitely not Unix nor Linux, and asking how to modify it is even farther off-topic. – vonbrand Jan 17 '16 at 17:25
  • I'm voting to close this question as off-topic because modifying Minix isn't about Unix/Linux at all. – vonbrand Jan 17 '16 at 17:25
  • I can only spell minix, but it seems UNIX-like to me, and Wikipedia makes an unsubstantiated claim of its posix compliance en.m.wikipedia.org/wiki/MINIX – Jeff Schaller Jan 17 '16 at 17:50
  • 2
    (1) Both the U&L tour and our Help Center say that this community is "for users of Linux, FreeBSD and other Un*x-like operating systems."  There's ample evidence that Minix is Unix-like, if not POSIX-compliant, so it is on-topic.  (2) This question is not about modifying the operating system; it is about how to get the system time in millisecond or better granularity/precision.  That's not a programming question; that's an OS interface question. (3) Therefore, this question is on-topic here. – G-Man Jan 17 '16 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.