I'm sending transactions using Python 3 and mxpy. When the transaction ends with status "success", I have in the transaction's data a timestamp that I think it is the time the transactions entered the blockchain. But, is there a way to know another timestamp with the time that the transaction was resolved?
I want to know how much time took to process a single transaction.
I would say that (at the moment I write this) computation of the processing time for a transaction is not a trivial task to perform. The reason why this is happening is because of sharding and how processing can happen cross-shard. The rough idea (as far as I understand it) is the following:
You have to note the fact that a transaction can vary widely in terms of what it is purposed for. It can range from a simple value transfer from one account to another, intra-shard or cross-shard, to crazy daisy-chained operations like a Smart Contract call that in turn might call another Smart Contract and each of these might be generating Smart Contract Results which have to propagate back in a similar way a simple transaction would (these are basically also transactions). So you have to calculate from the first timestamp (usually the timestamp of the first block that included the transaction on the sender shard) all the way to the timestamp of the destination block that included the last event the transaction processing triggered.
Technical-wise, you would have to dig for those blocks via several tx data parses, cross the data between these different hashes and I believe it would go something like this:
Also take this info with a bit of salt, as I'm not 100% confident that this is the right approach to do this calculation.