•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 402,048 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,537 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 1099 | Replies: 5
![]() |
•
•
Join Date: May 2008
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
Hi
I have to make a C program which has to perform a specified event at a specified time. Something like this...
Assume that these instructions are already available. I am thinking of creating a doubly linked list which will hold the hour, minute & the text. Then, I will sort them, keeping the earliest event at the start of the list. The problem now is how to make sure that the required event occurs at the very moment that it is supposed to occur. I am thinking that I might require a sort of program that would periodically check the current time(hour, then minute) with that stored in the list. But how should I do this? Also, is there a more efficient way of performing this sort of check?
I have to make a C program which has to perform a specified event at a specified time. Something like this...
Print Hello at 13:15 Print Bye at 14:20 Print working at 13:57
Work out the time between "now" and the time at the head of the list.
Sleep for that amount?
Sleep for that amount?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
>i would this in DOS using TSR program to fire events with....
I would too...15 years ago, and only on DOS because TSRs were a hack to get around the weaknesses of an OS that couldn't handle more than one running program at a time. Now I'd use the event management or polling mechanisms of whatever multitasking OS the program is written for.
>Is it then possible to update the sleep time accordingly?
Yes, but then you're entering the realm of multiple threads/processes. One thread polls for changes to the requirements and another performs work based on the currently saved requirements.
I would too...15 years ago, and only on DOS because TSRs were a hack to get around the weaknesses of an OS that couldn't handle more than one running program at a time. Now I'd use the event management or polling mechanisms of whatever multitasking OS the program is written for.
>Is it then possible to update the sleep time accordingly?
Yes, but then you're entering the realm of multiple threads/processes. One thread polls for changes to the requirements and another performs work based on the currently saved requirements.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: boolean expression as a for loop iteration (???)
- Next Thread: assigning a char pointer to a struct member of similar type ........



Linear Mode