MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / set

Method set

projects/JavaScript/proto/fbe.js:1867–1875  ·  view source on GitHub ↗

* Set the timestamp value * @this {!FieldModelTimestamp} * @param {!Date} value Value

(value)

Source from the content-addressed store, hash-verified

1865 * @param {!Date} value Value
1866 */
1867 set (value) {
1868 console.assert(((this._buffer.offset + this.fbeOffset + this.fbeSize) <= this._buffer.size), 'Model is broken!')
1869 if ((this._buffer.offset + this.fbeOffset + this.fbeSize) > this._buffer.size) {
1870 return
1871 }
1872
1873 let nanoseconds = UInt64.fromNumber(value.getTime()).mul(1000000)
1874 this.writeUInt64(this.fbeOffset, nanoseconds)
1875 }
1876}
1877
1878exports.FieldModelTimestamp = FieldModelTimestamp

Callers

nothing calls this directly

Calls 3

writeUInt64Method · 0.80
mulMethod · 0.45
fromNumberMethod · 0.45

Tested by

no test coverage detected