c - float value in - struct itimerspec -


I have this problem: I have created a structure using the etymerspeak structure. There are two fields in the Etymerspeak structure:

  Structure TimeSpeak {time_t tv_sec; / * Seconds * / long TV_NSC; / * Nanoseconds /}; Structure itimerspec {struct timespec it_interval; / * Timer Interval * / Straight TimesPack it_value; / * Initial Term * /};   

So when I'm entering:

  Enter the code here itimerspec; // logic timer_gettime / * setting timer interval * / its.it_interval.tv_sec = 0; Its.it_interval.tv_nsec = 1; / * Timer End Installation * / its.it_value.tv_sec = 0.1; // First end after 1 second its.it_value.tv_nsec = 0; On the compilation: Prototype 1. CCT1515: Warning: change from one to â __ __ time_tâ ????   

My problem is this: According to the design, the user can enter the whole number (1, 2, 3 etc., timer end, which is fine) but time is also recorded as 0.1 seconds Can O.2 seconds, etc. But in seconds only.

You have to adjust with seconds and nanosec, like 0.1 seconds = 0 seconds and 100,000 ensecs.

Comments