Blockland Forums > Modification Help
[CHALLENGE] Rosetta Code - "Tasks not implemented in torquescript"
Daenth:
--- Quote from: elm on June 18, 2012, 12:02:14 AM ---I'll leave this one for Zacko.
http://rosettacode.org/wiki/Time_a_function
--- End quote ---
--- Code: ---function timeFunction(%function)
{
%start = getSimTime();
eval(%function);
%end = getSimTime();
echo(%function SPC "took" SPC (%end - %start) SPC "milliseconds to complete.");
}
--- End code ---
?
EDIT: Greek's is far more superior, haha.
Port:
--- Quote from: Daenth on June 18, 2012, 01:07:53 AM ---
--- Code: ---function timeFunction(%function)
{
%start = getSimTime();
eval(%function);
%end = getSimTime();
echo(%function SPC "took" SPC (%end - %start) SPC "milliseconds to complete.");
}
--- End code ---
?
EDIT: Greek's is far more superior, haha.
--- End quote ---
This wouldn't work anyway. getSimTime measures how many milliseconds the engine has been simulating so far. It doesn't simulate while the main thread (well really, the only thread) is running TorqueScript code.
Daenth:
--- Quote from: Port on June 18, 2012, 02:01:10 AM ---This wouldn't work anyway. getSimTime measures how many milliseconds the engine has been simulating so far. It doesn't simulate while the main thread (well really, the only thread) is running TorqueScript code.
--- End quote ---
Ah, that makes sense.
Destiny/Zack0Wack0:
25% of those tasks should be not considered.
Lugnut:
--- Quote from: Destiny/Zack0Wack0 on June 18, 2012, 02:45:30 AM ---25% of those tasks should be not considered.
--- End quote ---
because they aren't possible?
because they are too stupid?
what do you mean