Sergei G
/
JobSchedulerDemo
run once and run periodic example work
Diff: source/main.cpp
- Revision:
- 3:dd0e559a9ff7
- Parent:
- 2:4fe42e3bafe4
- Child:
- 5:79cbf6d8b5f0
--- a/source/main.cpp Tue Jul 11 20:35:35 2017 +0000 +++ b/source/main.cpp Tue Jul 11 21:48:11 2017 +0000 @@ -19,29 +19,13 @@ scheduler.Start(); time_t nowSecs = time(NULL); - scheduler.JobAdd(1, new JobScheduler::RunOnceSchedule(nowSecs + 5), NULL); + JobScheduler::Response<JobScheduler::JobID> res = scheduler.JobAdd(1, new JobScheduler::RunOnceSchedule(nowSecs + 5), NULL); + printf("job add response error: %d, jobID: %d\n", res.error, res.data); wait(5); scheduler.Stop(); scheduler.WaitToStop(); } -void useTime() -{ - //set_time(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37 -// while (true) { -// -// printf("Time as seconds since January 1, 1970 = %d\n", seconds); -// -// printf("Time as a basic string = %s", ctime(&seconds)); -// -// char buffer[32]; -// strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds)); -// printf("Time as a custom formatted string = %s", buffer); -// -// wait(1); -// } -} - int main() { printf("\nJob Scheduler Demo\n");