mirror of
https://github.com/LIV2/libnix.git
synced 2025-12-06 00:23:08 +00:00
refs #88: use old clock for kick1.3
This commit is contained in:
parent
77d11ca4ef
commit
8a9cdc9d5c
20
sources/nix13/extra/clock.c
Normal file
20
sources/nix13/extra/clock.c
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include <time.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <dos/dos.h>
|
||||||
|
#include <proto/dos.h>
|
||||||
|
#include "stabs.h"
|
||||||
|
|
||||||
|
static struct DateStamp ds;
|
||||||
|
|
||||||
|
void __initclock(void)
|
||||||
|
{ DateStamp(&ds); }
|
||||||
|
|
||||||
|
ADD2INIT(__initclock,-10);
|
||||||
|
|
||||||
|
clock_t clock(void)
|
||||||
|
{ struct DateStamp ds2;
|
||||||
|
DateStamp(&ds2);
|
||||||
|
return (((ds2.ds_Days-ds.ds_Days)*(24*60)+
|
||||||
|
ds2.ds_Minute-ds.ds_Minute)*(60*TICKS_PER_SECOND)+
|
||||||
|
ds2.ds_Tick-ds.ds_Tick)*CLOCKS_PER_SEC/TICKS_PER_SECOND;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user