# StructTimeval

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# StructTimeval

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/system/StructTimeval "View this page in Java")  

```
class StructTimeval
```

|---|--------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                               ||
| ↳ | [android.system.StructTimeval](https://developer.android.com/reference/kotlin/android/system/StructTimeval#) |

Corresponds to C's`struct timeval`from`sys/time.h`.

## Summary

|                                                                                                                                                      Public methods                                                                                                                                                       ||
|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                  | [equals](https://developer.android.com/reference/kotlin/android/system/StructTimeval#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` <br />            |
| static[StructTimeval](https://developer.android.com/reference/kotlin/android/system/StructTimeval#) | [fromMillis](https://developer.android.com/reference/kotlin/android/system/StructTimeval#fromMillis(kotlin.Long))`(`millis:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                          | [hashCode](https://developer.android.com/reference/kotlin/android/system/StructTimeval#hashCode())`()` <br />                                                                                                        |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)                        | [toMillis](https://developer.android.com/reference/kotlin/android/system/StructTimeval#toMillis())`()` <br />                                                                                                        |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                    | [toString](https://developer.android.com/reference/kotlin/android/system/StructTimeval#toString())`()` <br />                                                                                                        |

|                                                                                               Properties                                                                                               ||
|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [tv_sec](https://developer.android.com/reference/kotlin/android/system/StructTimeval#tv_sec:kotlin.Long) Seconds.        |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [tv_usec](https://developer.android.com/reference/kotlin/android/system/StructTimeval#tv_usec:kotlin.Long) Microseconds. |

## Public methods

### equals

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

|                     Parameters                     ||
|-------|---------------------------------------------|
| `obj` | the reference object with which to compare. |

|                                                                           Return                                                                           ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if this object is the same as the obj argument;`false`otherwise. |

### fromMillis

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun fromMillis(millis: Long): StructTimeval
```

|                                                           Return                                                           ||
|-----------------------------------------------------------------------------------------------|-----------------------------|
| [StructTimeval](https://developer.android.com/reference/kotlin/android/system/StructTimeval#) | This value cannot be`null`. |

### hashCode

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### toMillis

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toMillis(): Long
```  

### toString

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |

## Properties

### tv_sec

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
val tv_sec: Long
```

Seconds.  

### tv_usec

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
val tv_usec: Long
```

Microseconds.