Partager via


LongAdder.Sum Method

Definition

Returns the current sum.

[Android.Runtime.Register("sum", "()J", "GetSumHandler", ApiSince=24)]
public virtual long Sum ();
[<Android.Runtime.Register("sum", "()J", "GetSumHandler", ApiSince=24)>]
abstract member Sum : unit -> int64
override this.Sum : unit -> int64

Returns

the sum

Attributes

Remarks

Returns the current sum. The returned value is <em>NOT</em> an atomic snapshot; invocation in the absence of concurrent updates returns an accurate result, but concurrent updates that occur while the sum is being calculated might not be incorporated.

Java documentation for java.util.concurrent.atomic.LongAdder.sum().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to