Skip to content

Commit

Permalink
feat: provide a local now() method to get current time
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Apr 30, 2024
1 parent 97dc597 commit 640a35b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package io.github.vyfor.kpresence.rpc

import io.github.vyfor.kpresence.utils.epochMillis

@DslMarker
annotation class ActivityDSL

Expand Down Expand Up @@ -123,7 +125,12 @@ class ActivityTimestampsBuilder {
* Unix time (in milliseconds) of when the activity ends.
*/
var end: Long? = null


/**
* Returns the current time in milliseconds since the Unix epoch.
*/
fun now(): Long = epochMillis()

/**
* Builds the configured ActivityTimestamps instance.
* @return The constructed ActivityTimestamps instance.
Expand Down

0 comments on commit 640a35b

Please sign in to comment.