This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executing a Shell-Skript

 
hal arres
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to execute a shell-script using Runtime.getRuntime.exec(), but it seems to be very slow.

Executing the Skript from console it takes nearly 100 milliseconds, using Runtime.getRuntime.exec() it takes 700 milliseconds.

What do I have to do to increase the speed or is there a faster way to execute a shell script?

Thanks for any help,
Hal
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no reason why executing a script from Runtime.exec() should be slow. How are you measuring the times? Do the commands within the script run slower, or is it slower to start up? What does the script do?
 
hal arres
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To measur the time in the console I am using the command time, which prints the used time in milliseconds.
In Java I subtract two Dates:


The script is a driver for a webservice, it sends requests to a service an prints the response.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic