File: clock.c

package info (click to toggle)
miredo 1.2.6-7.2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 3,600 kB
  • sloc: sh: 11,947; ansic: 7,823; makefile: 292; sed: 16
file content (46 lines) | stat: -rw-r--r-- 1,518 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * clock.c - Libteredo clock tests
 */

/***********************************************************************
 *  Copyright © 2007 Rémi Denis-Courmont.                              *
 *  This program is free software; you can redistribute and/or modify  *
 *  it under the terms of the GNU General Public License as published  *
 *  by the Free Software Foundation; version 2 of the license, or (at  *
 *  your option) any later version.                                    *
 *                                                                     *
 *  This program is distributed in the hope that it will be useful,    *
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of     *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               *
 *  See the GNU General Public License for more details.               *
 *                                                                     *
 *  You should have received a copy of the GNU General Public License  *
 *  along with this program; if not, you can get it from:              *
 *  http://www.gnu.org/copyleft/gpl.html                               *
 ***********************************************************************/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#undef NDEBUG
#include <assert.h>
#include <sched.h>

#include "clock.h"

int main (void)
{
	teredo_clock_t start = teredo_clock (), now;

	do
	{
		now = teredo_clock ();
		sched_yield ();
	}
	while (now == start);

	assert (now > start);

	return 0;
}