messagelayer.Tangle().Events.MessageSolid.Attach(events.NewClosure(func(cachedMsgEvent*tangle.CachedMessageEvent){// When receiving a message solid event do
//cachedMsgEvent.MessageMetadata.Consume(func(object objectstorage.StorableObject) { This was a more accurate way to mesure the solidification time but crashed the nodes sometimes for some reason
cachedMsgEvent.Message.Consume(func(message*tangle.Message){// Consume the message and call the function
solidificationTime:=time.Now().UnixNano()// Since we just received the message, that means the message just got solidificated, so this is a close approximation, which is good enough for now
to_write:=fmt.Sprintf("%d;%s;%s\n",solidificationTime-message.IssuingTime().UnixNano(),message.ID(),message.String())// Write the data to the file