# Status.TimerOrStopwatchPart

# Status.TimerOrStopwatchPart

Artifact:[androidx.wear:wear-ongoing](https://developer.android.com/jetpack/androidx/releases/wear)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/ongoing/Status.java+class:androidx.wear.ongoing.Status.TimerOrStopwatchPart)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart "View this page in Java")

<br />

```
abstract class Status.TimerOrStopwatchPart : Status.Part
```

<br />

|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                          |||
| ↳ | [androidx.wear.ongoing.Status.Part](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.Part)                                    ||
|   | ↳ | [androidx.wear.ongoing.Status.TimerOrStopwatchPart](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart) |

Known direct subclasses  
[Status.StopwatchPart](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.StopwatchPart),[Status.TimerPart](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerPart)  

|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|
| [Status.StopwatchPart](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.StopwatchPart) | An Ongoing activity status (or part of it) representing a stopwatch |
| [Status.TimerPart](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerPart)         | An Ongoing activity status (or part of it) representing a timer.    |

*** ** * ** ***

Base class for[TimerPart](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerPart)and[StopwatchPart](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.StopwatchPart), defines the getters but can't be created directly, create one of those instead.

## Summary

|                                      ### Public functions                                      |
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)            | [equals](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#equals(java.lang.Object))`(obj: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                                                                 |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                  | [getNextChangeTimeMillis](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getNextChangeTimeMillis(long))`(fromTimeMillis: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` See[getNextChangeTimeMillis](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/TimeDependentText#getNextChangeTimeMillis(long))                                                                            |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                  | [getPausedAtMillis](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getPausedAtMillis())`()`                                                                                                                                                                                                                                                                                                                                              |
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html) | [getText](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getText(android.content.Context,long))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`, timeNowMillis: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` See[getText](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/TimeDependentText#getText(android.content.Context,long)) |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                  | [getTimeZeroMillis](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getTimeZeroMillis())`()`                                                                                                                                                                                                                                                                                                                                              |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                  | [getTotalDurationMillis](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getTotalDurationMillis())`()`                                                                                                                                                                                                                                                                                                                                    |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)            | [hasTotalDuration](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#hasTotalDuration())`()` Determines if this has a total duration set.                                                                                                                                                                                                                                                                                                   |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                    | [hashCode](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#hashCode())`()`                                                                                                                                                                                                                                                                                                                                                                |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)            | [isCountDown](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#isCountDown())`()`                                                                                                                                                                                                                                                                                                                                                          |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)            | [isPaused](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#isPaused())`()` Determines if this Timer or Stopwatch is paused. i.e. the display representation will not change over time.                                                                                                                                                                                                                                                    |

## Public functions

### equals

```
fun equals(obj: Any?): Boolean
```  

### getNextChangeTimeMillis

```
fun getNextChangeTimeMillis(fromTimeMillis: Long): Long
```

See[getNextChangeTimeMillis](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/TimeDependentText#getNextChangeTimeMillis(long))  

### getPausedAtMillis

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)  

```
fun getPausedAtMillis(): Long
```  

|                                    Returns                                    |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | the timestamp of the time when this was paused. Use[isPaused](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#isPaused())to determine if this is paused or not. |

### getText

```
fun getText(context: Context, timeNowMillis: Long): CharSequence
```

See[getText](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/TimeDependentText#getText(android.content.Context,long))  

### getTimeZeroMillis

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)  

```
fun getTimeZeroMillis(): Long
```  

|                                    Returns                                    |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | the time at which this Timer or Stopwatch will display 0, will usually be in the past for a stopwatch and in the future for timers. |

### getTotalDurationMillis

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)  

```
fun getTotalDurationMillis(): Long
```  

|                                    Returns                                    |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | the total duration of this timer/stopwatch, if set. Use[hasTotalDuration](https://developer.android.com/reference/kotlin/androidx/wear/ongoing/Status.TimerOrStopwatchPart#hasTotalDuration())to determine if this has a duration set. |

### hasTotalDuration

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)  

```
fun hasTotalDuration(): Boolean
```

Determines if this has a total duration set.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|---------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | `true`if this the total duration was set,`false`if not. |

### hashCode

```
fun hashCode(): Int
```  

### isCountDown

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)  

```
fun isCountDown(): Boolean
```  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | `false`if this is a stopwatch or`true`if this is a timer. |

### isPaused

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)  

```
fun isPaused(): Boolean
```

Determines if this Timer or Stopwatch is paused. i.e. the display representation will not change over time.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | `true`if this is paused,`false`if it's running. |