mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete * 2.1.0 main node rollup
18 lines
510 B
Go
18 lines
510 B
Go
package frametime
|
|
|
|
import (
|
|
"time"
|
|
|
|
"source.quilibrium.com/quilibrium/monorepo/protobufs"
|
|
)
|
|
|
|
// AppFrameSince returns the time elapsed since the given frame was created.
|
|
func AppFrameSince(frame *protobufs.AppShardFrame) time.Duration {
|
|
return time.Since(time.UnixMilli(frame.Header.Timestamp))
|
|
}
|
|
|
|
// GlobalFrameSince returns the time elapsed since the given frame was created.
|
|
func GlobalFrameSince(frame *protobufs.GlobalFrame) time.Duration {
|
|
return time.Since(time.UnixMilli(frame.Header.Timestamp))
|
|
}
|