The process time value can be: a numeric single value; a string expression that is evaluated to lookup or generate a number, or multi-line code that does the same (also string).
When you say you want to "define the process time by code" it can mean two things - you can:
1) have that code as the process time expression/script to fire for each item
2) write the value/expression/script into the process time property using code (triggered elsewhere)
Of course you could be doing both of those things - trigger a script that writes an expression or script to the process time property (last example below).
Examples:
combiner.setProperty("ProcessTime", normal(10,1)); //writes a random value once to the combiner - eg. 10.5 will be used until you set another value.
combiner.setProperty("ProcessTime", "normal(10,1,getstream(ownerobject(c)))"); // writes the single line expression to be evaluated each time a process time is needed. (notice no semicolon at the end of the expression)
Lastly the code to write the script will look like this where the lines are seperated by semicolons and crucially the process time is returned by the script we supplied.
string newValue = "Object current=ownerobject(c); \
double sampletime=normal(10,1,getstream(current)); \
return sampletime;";
combiner.setProperty("ProcessTime", newValue);
Note the last two examples generate the same random samples.