I knew that srand was based off the system clock and calculated fractions of seconds. I just didn't realize that a loop could iterate that fast I guess.
This also solves other problems I was having this program. Much appreciated!
hi all,
i have been trying to get a script working that can take in more than one option using getopt. But for some reason, even when i type in a covered option, it skips directly to my error message of "no match." Any ideas of what might be wrong?
set - 'getopt frd*: $*'
for i in $*
do... (6 Replies)
Hello ,
How to resolve below compilation error.activity_type is a member of structure and the output from databse will be stored in structure.Expected output wil l be either D or N or C .
sample struct format:
struct a{
char acAtivity_type;
}
code:
switch (a->activity_type)... (1 Reply)
I am just learning Tcl and there are few things about it that is perplexing me. I have a question about the switch statement.
Why are these two switch statements giving me different results?
$ cat test_switch.tcl
#!/usr/bin/tcl
set foo "abc"
switch abc a - b {puts "No. 1"} $foo {puts... (2 Replies)
Hey ,
I'm trying to perform the following command, however it cannot read the variable assigned earlier. I'm not sure why this happen. Please help thanks
while :
do
echo "what's ur name? (if none just press )"
read name
changeName = echo $name | sed "s/on/ey/"
echo $changeName #this... (8 Replies)
I started writing a script to save the files from a camera I got the other day, which mounts in /Volumes , and I got into it and started building this menu. The only problem is that the switch case is coming up as a syntax error at the parenthesis after a case. Here is the code:
while :
do
... (2 Replies)
Hello
i have a requirement where in a file i will get string. The length could be from 1 to 20. if the string is less than 6 characters ( ex: ABCD) . i need to append 'X' on right hand side to make it 6 characters (ex: ABCDXX). if suppose i get the same string from the file as ABCDXX then i... (5 Replies)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
I need to implement a looping logic.
If then
Go to /path1/file*
Get all the filename starting with file* and store it in a array
count file number and store it in variable like run
Ex: I found 3 file with starting file* so my run = 3
means my loop should run three time
May be... (1 Reply)
Discussion started by: Nsharma3006
1 Replies
LEARN ABOUT OSX
pacemaker
PACEMAKER(8) BSD System Manager's Manual PACEMAKER(8)NAME
pacemaker -- clock drift adjustment daemon
SYNOPSIS
pacemaker [-d drift] [-b] [-e error] [-a interval] [-i] [-v] [-n]
DESCRIPTION
pacemaker adjusts the system clock periodically to compensate for clock drift. The clock drift is normally computed by ntpd(8), which writes
a clock drift value in /var/db/ntp.drift. By default, pacemaker will call adjtime(2) once per second to slew the system clock. The daemon
is started by launchd(8) only when the drift file is present or has just been created in the file system. pacemaker detects changes in the
file and re-calculates clock adjustment values appropriately. The daemon will exit if the drift file is deleted and is not re-created within
one minute.
As a fail-safe mechanism, pacemaker will reset the system clock using settimeofday(2) if the system clock requires adjustment exceeding the
maximum value that can be accomodated by adjtime to slew the clock. In practice, this extreme case should never occur.
The -d option allows the specification of either a floating-point drift value, or the path name of an alternate drift file. If a floating
point drift value is specified, pacemaker will use the given value and will not read a drift file.
To reduce power consumption, especially when the system is using internal battery power, it may be desirable to reduce the frequency of calls
to adjust the system's clock drift. The -e and -a options, together with the -b flag allow several ways to control the clock adjustment fre-
quency.
The floating point value following -e specifies a maximum error tolerance in seconds for the system clock. For example, a value of 0.001
specifies that the clock drift adjustment should only be done frequently enough to keep the system clock error within one millisecond, based
on the current clock drift rate.
Alternatively, the clock adjustment frequency can be specified exactly as a value in seconds following -a.
When both -e error and -a interval are provided, pacemaker will choose to adjust the system clock either every interval seconds, or less fre-
quently if the clock error will remain within error seconds.
The settings for -e and/or -a may be specified for operation of the system while using an external power source, and specified independently
for operation using internal batteries. By default, the values for -e and/or -a are used for both power configurations. If the -b flag pre-
cedes -e and/or -a, then the following settings apply only when the system is using internal battery power.
For example, starting pacemaker with the following parameters will cause it to adjust the clock every 2 seconds when the system is using
external power. When running on battery power, it will adjust the clock no more than once every 10 seconds, or less frequently if the clock
error remains less than five milliseconds.
pacemaker -a 2 -b -a 10 -e 0.005
When invoked on the command-line with -i, pacemaker prints a summary of internal parameters and then exits. The -v flag causes pacemaker to
print copies of its log messages to standard error. Note that this requires running the program from the command line rather than from
launchd. -n causes pacemaker to run without actually attempting to adjust the system clock.
FILES
/var/db/ntp.drift default clock drift file
SEE ALSO launchd(8), ntpd(8), adjtime(2), settimeofday(2).
HISTORY
The pacemaker daemon was introduced in OS X 10.9.
OS X March 9, 2013 OS X