Sleep method in Mirth

There are situations where in you will configure your source connector as “Database Reader”.
Assuming you define a polling frequency of 10seconds.

Now at the source transformer level, you write several lines of java script code to interact further with data values fetched from the query defined at source connector level.
This may crash the Database server, as the polling frequency is pretty less and it fires the query immediately because you have defined them at the connector level.

You can save yourself in many ways, but I feel this sounds more suitable to implement a delay as the very first transformer (Step 1 among all your steps).

Below is the java script code; can be embedded into any source transformer in Mirth.

function dummySleep(delay)
//channelMap.put("Beforetime", new Date().getTime().toString());
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
//channelMap.put("aftertime", new Date().getTime().toString());