# include # include # include # include "walker_sample.h" int main ( ); void timestamp ( ); /******************************************************************************/ int main ( ) /******************************************************************************/ /* Purpose: walker_sample_test() tests walker_sample(). Licensing: This code is distributed under the MIT license. Modified: 20 February 2016 Author: John Burkardt */ { timestamp ( ); srand48 ( time ( NULL ) ); printf ( "\n" ); printf ( "walker_sample_test():\n" ); printf ( " C version.\n" ); printf ( " Test walker_sample().\n" ); walker_sampler_test ( ); /* Terminate. */ printf ( "\n" ); printf ( "walker_sample_test():\n" ); printf ( " Normal end of execution.\n" ); printf ( "\n" ); timestamp ( ); return 0; } /******************************************************************************/ void timestamp ( ) /******************************************************************************/ /* Purpose: timestamp() prints the current YMDHMS date as a time stamp. Example: 17 June 2014 09:45:54 AM Licensing: This code is distributed under the MIT license. Modified: 17 June 2014 Author: John Burkardt */ { # define TIME_SIZE 40 static char time_buffer[TIME_SIZE]; const struct tm *tm; time_t now; now = time ( NULL ); tm = localtime ( &now ); strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); printf ( "%s\n", time_buffer ); return; # undef TIME_SIZE }