Add custom value in table on update

What I trying to do is to get the difference between a given time in the entity an current time, presented in each table row.
Where do I put the code so that it loads the time in a new column value field.

Try to use the Table.addGeneratedColumn() method explained here: