Index: XmlTools2/trunk/readme.txt
===================================================================
--- XmlTools2/trunk/readme.txt	(revision 956)
+++ XmlTools2/trunk/readme.txt	(revision 958)
@@ -1,5 +1,5 @@
 Readme.txt
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-XmlTools v2.0
+XmlTools v2.0a
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -62,4 +62,10 @@
 Change Log:
 ----------------------------------
+2.0a, 15-02-2014
+-Added multithreading support for @CUSTOM_COMMAND, use wildcards in multiple files for the same js code to 
+take advantage of this (performance may increase over 2.5 times)
+-Now a warning is given if a user javascript code (@CUSTOM_COMMAND) takes too much time to finish
+-Fixed small bug when applying patches with @COMMAND + --no-verbose where some std output should not be displayed
+----------------------------------
 2.0, 08-02-2014
 -Rewrite XmlTools fom the scratch from C# to C++ in order to increase (much!) the performance of the program
Index: XmlTools2/trunk/util.cpp
===================================================================
--- XmlTools2/trunk/util.cpp	(revision 956)
+++ XmlTools2/trunk/util.cpp	(revision 958)
@@ -8,5 +8,5 @@
 QString AppExecutable="./"+AppName; // Mac OS needs unix like executing
 #endif
-QString AppVersion="2.0";
+QString AppVersion="2.0a";
 }
 
Index: XmlTools2/trunk/xmlpatch.cpp
===================================================================
--- XmlTools2/trunk/xmlpatch.cpp	(revision 956)
+++ XmlTools2/trunk/xmlpatch.cpp	(revision 958)
@@ -245,4 +245,6 @@
         QScriptEngine engine;
         QScriptValue engineResult; // variable to check for js_errors
+        double elapsed_secs; // elapsed seconds that a user script took
+        clock_t begin; // seconds that a script started
 
         // Add echo function so user can debug the code
@@ -269,6 +271,23 @@
         engine.globalObject().setProperty("$xmlData",currXmlFileString);
 
+        if(this->verboseEnabled){
+            begin = clock();
+        }
+
         // main needs to be called so the user code is evaluated
+        // alternatively you can do: myFunc=engine.evaluate('(function main(){})'); myFunc.call();
+        // Note the () around the function
         engineResult=engine.evaluate("main(); function main() {"+jsString+"}"); // main funtion allows to use return to exit prematurely from user code
+
+        if(this->verboseEnabled){
+            elapsed_secs = double(clock() - begin) / CLOCKS_PER_SEC;
+
+            // Warn the user if the script took much time
+            if(elapsed_secs>SLOW_SCRIPT_TIME){
+                std::cout << "Warning: Slow javascript code detected.\n" <<
+                             "Warning: Script execution seconds: " << elapsed_secs
+                          << std::endl;
+            }
+        }
 
         if (engine.hasUncaughtException()) {
@@ -433,9 +452,9 @@
             // Add --no-backups and --no-verbose if patch was called with that arguments
             if(!this->backupsEnabled){
-                command.append(" --no-backups");
+                command.append(" --no-backups ");
             }
 
             if(!this->verboseEnabled){
-                command.append(" --no-verbose");
+                command.append(" --no-verbose ");
             }
 
Index: XmlTools2/trunk/xmlpatch.h
===================================================================
--- XmlTools2/trunk/xmlpatch.h	(revision 956)
+++ XmlTools2/trunk/xmlpatch.h	(revision 958)
@@ -5,4 +5,7 @@
 #include "optionsparser.h"
 #include <omp.h> // OpenMP support
+#include <ctime> // script execution time calculation
+
+#define SLOW_SCRIPT_TIME 0.1 // if a user script takes more than 0.1 seconds to execute give a warning.
 
 class XmlPatch
