Batch program in Xwindows


5 posts
by Ray_GTI-R » Wed Jun 27, 2012 1:39 am
Hi.
I want to write a batch program to stress the CPU for temperature checking (using an IR gun) that does something like this in an xwindows terminal window (to keep things simple):-
Calculate 22 divided by 7 to e.g, 10 places then display the result then do it again x times where x can be modified by editing the batch program.
I would prefer a simple loop that 61-year-old kids like me can follow:-

for n=1 to x
22 /7 (display the result to 10 places in the terminal window)
next n

Any ideas?
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by abishur » Wed Jun 27, 2012 1:55 am
You could use a while loop and never have the condition fulfilled such that you have to ctrl+c to end it after your tests
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4279
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by Ray_GTI-R » Wed Jun 27, 2012 2:17 am
Can you give me an xwindows terminal code example where the result is calculated to e.g., 10 decimal places?

TIA, Ray
User avatar
Posts: 96
Joined: Fri Mar 09, 2012 1:21 am
by abishur » Wed Jun 27, 2012 3:41 am
I'll give it some thought. The more I consider it, I'm not sure if running such a loop would tax the processor as much as you'd like. Just having the gui up at all seems to tax it a fair deal... you might be better off writing a script to refresh a simple webpage every x seconds and tax it a lot more!
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4279
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by andyl » Wed Jun 27, 2012 8:19 am
abishur wrote:I'll give it some thought. The more I consider it, I'm not sure if running such a loop would tax the processor as much as you'd like. Just having the gui up at all seems to tax it a fair deal... you might be better off writing a script to refresh a simple webpage every x seconds and tax it a lot more!


There is a debian package called cpuburn which is specifically designed for stress-testing the cpu.
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am