Erinevused
Siin näed erinevusi valitud versiooni ja hetkel kehtiva lehekülje vahel.
kola:lpt-soft [2011/02/18 21:19] alvar |
kola:lpt-soft [2020/07/29 12:35] |
||
---|---|---|---|
Rida 1: | Rida 1: | ||
- | ====== Soft, mis arvestab teo tööaega ====== | ||
- | |||
- | < | ||
- | #include < | ||
- | #include < | ||
- | #include < | ||
- | #include < | ||
- | |||
- | int main(void) | ||
- | { | ||
- | int addr=0x379; | ||
- | int data, i, tsyklid, yhed; | ||
- | FILE *out_file; | ||
- | time_t seconds; | ||
- | double protsent; | ||
- | // requires EPP mode in BIOS | ||
- | ioperm(addr, | ||
- | |||
- | while (1) | ||
- | { | ||
- | tsyklid=1500; | ||
- | yhed=0; // nullime loenduri | ||
- | |||
- | for (i=0; | ||
- | { | ||
- | usleep(200*970); | ||
- | data=( inb(addr) & 128 ) /128; | ||
- | if (data) yhed++; | ||
- | protsent= ( (double) yhed/ (double) tsyklid) * 100; | ||
- | seconds = time (NULL); | ||
- | time ( & | ||
- | out_file = fopen("/ | ||
- | // läheb siis protsent, mis näitab katla | ||
- | // teo töötamist viimase 5 min jooksul | ||
- | fprintf (out_file," | ||
- | fclose(out_file); | ||
- | printf ( " | ||
- | } | ||
- | return(0); | ||
- | } | ||
- | </ | ||
- | |||
- | Tulemuseks on siis konsoolis: | ||
- | |||
- | protsent: 26.27 kell: Thu Feb 17 08:36:24 2011\\ | ||
- | protsent: 6.93 kell: Thu Feb 17 08:41:24 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 08:46:24 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 08:51:24 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 08:56:24 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 09:01:23 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 09:06:23 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 09:11:23 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 09:16:23 2011\\ | ||
- | protsent: 0.00 kell: Thu Feb 17 09:21:23 2011\\ | ||
- | protsent: 22.60 kell: Thu Feb 17 09:26:23 2011\\ | ||
- | protsent: 19.87 kell: Thu Feb 17 09:31:23 2011\\ | ||
- | protsent: 26.13 kell: Thu Feb 17 09:36:23 2011\\ | ||
- | protsent: 25.80 kell: Thu Feb 17 09:41:23 2011\\ | ||
- | \\ | ||
- | Ja mainitud failis lihtsalt: 25.80 | ||