/*
 * Copyright (C) 2003 ASANO Masahiro
 */

#include "def.h"

#define __KERNEL__
#include <linux/param.h>

void
mprint_HZ()
{
	mprintf("%d", HZ);
}

void
mprint_jif(jif)
	unsigned long jif;
{
	unsigned long day, hour, min, sec;

	day =  jif / (HZ*60*60*24);
	jif -= day * (HZ*60*60*24);
	hour = jif / (HZ*60*60);
	jif -= hour* (HZ*60*60);
	min  = jif / (HZ*60);
	jif -= min * (HZ*60);
	sec  = jif / (HZ);
	jif -= sec * (HZ);

	mprintf("%3ldd %02ld:%02ld:%02ld", day, hour, min, sec);
#if 1000 % HZ == 0
	mprintf(".%03ld", jif*(1000/HZ));
#else
	mprintf(".%03d", (int)(jif*(1000.0/HZ)));
#endif
}
