feisty meow concerns codebase 2.140
sleep_ms.cpp
Go to the documentation of this file.
1/*****************************************************************************\
2* *
3* Name : sleep_ms *
4* Author : Chris Koeritz *
5* *
6* Purpose: *
7* *
8* Takes a number from the command line and sleeps for that many milli- *
9* seconds. *
10* *
11*******************************************************************************
12* Copyright (c) 2001-$now By Author. This program is free software; you can *
13* redistribute it and/or modify it under the terms of the GNU General Public *
14* License as published by the Free Software Foundation; either version 2 of *
15* the License or (at your option) any later version. This is online at: *
16* http://www.fsf.org/copyleft/gpl.html *
17* Please send any updates to: fred@gruntose.com *
18\*****************************************************************************/
19
22#include <basis/definitions.h>
23#include <timely/time_control.h>
24
25#include <stdio.h>
26
27using namespace application;
28using namespace basis;
29using namespace timely;
30
33
34int main(int argc, char *argv[])
35{
36 if (argc < 2) {
37 printf("%s usage:\nThe first parameter is taken as the number of "
38 "milliseconds to sleep.\n", argv[0]);
39 return 1;
40 }
41
42 int snooze_ms;
43 sscanf(argv[1], "%d", &snooze_ms);
44 time_control::sleep_ms(snooze_ms);
45 return 0;
46}
47
48#ifdef __BUILD_STATIC_APPLICATION__
49 // static dependencies found by buildor_gen_deps.sh:
50 #include <algorithms/sorts.cpp>
54 #include <basis/astring.cpp>
56 #include <basis/environment.cpp>
57 #include <basis/guards.cpp>
58 #include <basis/mutex.cpp>
78 #include <timely/earth_time.cpp>
80 #include <timely/time_stamp.cpp>
81#endif // __BUILD_STATIC_APPLICATION__
82
static void sleep_ms(basis::un_int msec)
a system independent name for a forced snooze measured in milliseconds.
Constants and objects used throughout HOOPLE.
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
Definition array.h:30
#include <time.h>
int main(int argc, char *argv[])
DEFINE_INSTANCE_HANDLE;.
Definition sleep_ms.cpp:34
Aids in achievement of platform independence.