Consider an oldschool dotmatrix printer which prints typical
Consider an old-school dot-matrix printer, which prints typical pages
of text consisting of 50 lines of 80 characters each. A particular
printer can print 15 pages per minute. Assume that the time to write a
character to the printer\'s output register is negligible and that each
character printed requires 80 nsec to completely service the interrupt.
What percentage of CPU time is devoted to servicing this printer?
Solution
Given: Page size is of 50 lines of 80 characters each, i.e., 50 * 80 = 4000 characters per page.
A printer can print 15 pages per minute, i.e., 15 * 4000 = 60000 characters per minute.
Each character printed requires 80 nanoseconds to completely service the interrrupt.
To print 60,000 characters, it requires 60,000 * 80 = 4,800,000 nano seconds, i.e., 0.0048 seconds.
In a minute if the CPU can print 15 pages, it require 0.0048 seconds dedicated to print, and the remaining time, i.e., (60 seconds in a minute) 60 - 0.0048 = 59.52 seconds for the other works to be done by the CPU.
Coming to the question, what percentage of CPU time is devoted to servicing this printer.
0.0048 / 60 * 100 = 0.008 % time is dedicated to service the printer.
