Calculate duration of events in a Calendar

Hello, does anyone know how to calculate the duration of an event in a Calendar? If have been told that it could possibly be achieved via Javascript, but I do not know how to do it.

I have a Date/Time field and I would like to register the duration of the event in another field.

Any clues? Thanks!


It is desribed here how to extract start & end time of an event:

Next step could be calculating event duration...