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

Method set

projects/JavaScript/proto/fbe.js:4251–4260  ·  view source on GitHub ↗

* Set the timestamp value * @this {!FieldModelTimestamp} * @param {!Date} value Value * @returns {!number} Final model size

(value)

Source from the content-addressed store, hash-verified

4249 * @returns {!number} Final model size
4250 */
4251 set (value) {
4252 console.assert(((this._buffer.offset + this.fbeOffset + this.fbeSize) <= this._buffer.size), 'Model is broken!')
4253 if ((this._buffer.offset + this.fbeOffset + this.fbeSize) > this._buffer.size) {
4254 return 0
4255 }
4256
4257 let nanoseconds = UInt64.fromNumber(value.getTime()).mul(1000000)
4258 this.writeUInt64(this.fbeOffset, nanoseconds)
4259 return this.fbeSize
4260 }
4261}
4262
4263exports.FinalModelTimestamp = FinalModelTimestamp

Callers

nothing calls this directly

Calls 3

writeUInt64Method · 0.80
mulMethod · 0.45
fromNumberMethod · 0.45

Tested by

no test coverage detected