Search code examples
ethereumsoliditytron

Is there an alternate block.timestamp (Ethereum) for Tron? (Timers)


I am wanting to use block.timestamp as a way to generate a certain amount of currency per second by subtracting a current saved block.timestamp (let's say second 9999) by an older saved block.timestamp (let's say second 9990) which produces a 9-second difference. This difference is used to update a balance that adds x per second when called (hope that makes sense).

Currently, I tried to use block.timestamp but I noticed that this is used for the Ethereum smart contracts when I want to use this for Tron.

Is there an alternative block.timestamp for Tron? Or better question, is there a way to reproduce this timer mechanism to either update a balance x/second or call a function x times per second/minute? Thanks! Hope that all made sense.


Solution

  • block.timestamp actually works the same for tron! I just used it incorrectly and thought the error I kept getting was caused by block.timestamp.