summaryrefslogtreecommitdiff
path: root/lib/libc/time/difftime.c
blob: 285e535f215e622d9a27c438a792d2783d17f5be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/*	$OpenBSD: difftime.c,v 1.12 2015/02/10 01:24:28 tedu Exp $ */
/* This file is placed in the public domain by Matthew Dempsky. */

#include "private.h"

#define HI(t) ((double)(t & 0xffffffff00000000LL))
#define LO(t) ((double)(t & 0x00000000ffffffffLL))

double
difftime(time_t t1, time_t t0)
{
	return (HI(t1) - HI(t0)) + (LO(t1) - LO(t0));
}