Search code examples
cadence-workflowtemporal-workflow

Temporal: Using time related functions in activity implementation


The documentation says

Only use Workflow.currentTimeMillis() to get the current time inside a Workflow.

Does it apply only to workflows or activities as well? Can I use System.currentTimeMillis() in activity implementation?


Solution

  • The implementation constraints mentioned in docs applies to workflows and not the activities. System.currentTimeMillis() can be used in an activity implementation. OP here.