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 
27 using namespace application;
28 using namespace basis;
29 using namespace timely;
30 
33 
34 int 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:
52  #include <basis/astring.cpp>
53  #include <basis/common_outcomes.cpp>
54  #include <basis/environment.cpp>
55  #include <basis/guards.cpp>
56  #include <basis/mutex.cpp>
57  #include <basis/utf_conversion.cpp>
64  #include <filesystem/byte_filer.cpp>
65  #include <filesystem/directory.cpp>
66  #include <filesystem/filename.cpp>
69  #include <structures/checksums.cpp>
75  #include <textual/parser_bits.cpp>
76  #include <timely/earth_time.cpp>
77  #include <timely/time_control.cpp>
78  #include <timely/time_stamp.cpp>
79 #endif // __BUILD_STATIC_APPLICATION__
80 
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>
Definition: earth_time.cpp:37
int main(int argc, char *argv[])
DEFINE_INSTANCE_HANDLE;.
Definition: sleep_ms.cpp:34
Aids in achievement of platform independence.