@@ -885,11 +885,11 @@ void usage(int argc, const char* argv[]) {
885885 printf (" Executed in <n> threads if possible (optional feature).\n\n" );
886886 printf (" -i, --id <n>\n" );
887887 printf (" The ID of the federation that this reactor will join.\n\n" );
888- printf (" -s, --start-time <duration > <units> \n" );
889- printf (" The logical start time of the program, expressed as a duration since the epoch of the underlying system "
890- " clock.\n" );
888+ printf (" -s, --start-time <time-point > <units> \n" );
889+ printf (" The logical start time of the program, expressed as an absolute time point\n" );
890+ printf ( " which is the duration since the epoch of the underlying system clock.\n" );
891891 printf (" The units are nsec, usec, msec, sec, minute, hour, day, week or the plurals of those.\n" );
892- printf (" On linux, to compute a start time in 2 minutes you can do:. \n" );
892+ printf (" On linux, to compute a start time of 2 minutes into the future, expressed in seconds, do:\n" );
893893 printf (" `date -d \"2 minutes\" +%%s`.\n\n" );
894894#ifdef FEDERATED
895895 printf (" -r, --rti <n>\n" );
@@ -1261,3 +1261,15 @@ index_t lf_combine_deadline_and_level(interval_t deadline, int level) {
12611261 else
12621262 return (deadline << 16 ) | level ;
12631263}
1264+
1265+ void _lf_set_and_wait_for_start_time () {
1266+ if (!start_time_specified ) {
1267+ start_time = lf_time_physical ();
1268+ } else {
1269+ instant_t now = lf_time_physical ();
1270+ if (!fast && now < start_time ) {
1271+ lf_print ("Sleeping " PRINTF_TIME " ns until specified start time" , start_time - now );
1272+ lf_sleep (start_time - now );
1273+ }
1274+ }
1275+ }
0 commit comments