// import { Buffer } from "buffer"; var buf = new Buffer(1024); // var buf = new Uint8Array(1024); var view = new DataView(buf.buffer); var INTERVAL = 9999999; var time = (name, fn) => { console.log(name, fn()); // for (let i = 0; i < INTERVAL; i++) fn(); // console.time(name.padEnd("DataView.readBigUInt64 (LE)".length)); // for (let i = 0; i < INTERVAL; i++) fn(); // console.timeEnd(name.padEnd("DataView.readBigUInt64 (LE)".length)); // }; // console.log( // `Run ${new Intl.NumberFormat().format(INTERVAL)} times with a warmup:`, // "\n" }; var array = new Uint8Array(1024); new Uint8Array(buf.buffer).fill(255); time("Buffer[] ", () => buf[0]); time("Uint8Array[]", () => array[0]); console.log(""); time("Buffer.getBigInt64BE ", () => buf.readBigInt64BE(0)); time("DataView.getBigInt64 (BE)", () => view.getBigInt64(0, false).toString(10)); console.log(""); time("Buffer.readBigInt64LE ", () => buf.readBigInt64LE(0)); time("DataView.readBigInt64 (LE)", () => view.getBigInt64(0, true)); console.log(""); time("Buffer.getBigUInt64BE ", () => buf.readBigUInt64BE(0)); time("DataView.getBigUInt64 (BE)", () => view.getBigUint64(0, false)); console.log(""); time("Buffer.readBigUInt64LE ", () => buf.readBigUInt64LE(0)); time("DataView.readBigUInt64 (LE)", () => view.getBigUint64(0, true)); console.log(""); time("Buffer.getDoubleBE ", () => buf.readDoubleBE(0)); time("DataView.getDouble (BE)", () => view.getFloat64(0, false)); console.log(""); time("Buffer.readDoubleLE ", () => buf.readDoubleLE(0)); time("DataView.readDouble (LE)", () => view.getFloat64(0, true)); console.log(""); time("Buffer.getFloatBE ", () => buf.readFloatBE(0)); time("DataView.getFloat (BE)", () => view.getFloat32(0, false)); console.log(""); time("Buffer.readFloatLE ", () => buf.readFloatLE(0)); time("DataView.readFloat (LE)", () => view.getFloat32(0, true)); console.log(""); time("Buffer.getInt16BE ", () => buf.readInt16BE(0)); time("DataView.getInt16 (BE)", () => view.getInt16(0, false)); console.log(""); time("Buffer.readInt16LE ", () => buf.readInt16LE(0)); time("DataView.readInt16 (LE)", () => view.getInt16(0, true)); console.log(""); time("Buffer.getInt32BE ", () => buf.readInt32BE(0)); time("DataView.getInt32 (BE)", () => view.getInt32(0, false)); console.log(""); time("Buffer.readInt32LE ", () => buf.readInt32LE(0)); time("DataView.readInt32 (LE)", () => view.getInt32(0, true)); console.log(""); time("Buffer.readInt8 ", () => buf.readInt8(0)); time("DataView.readInt (t8)", () => view.getInt8(0)); console.log(""); time("Buffer.getUInt16BE ", () => buf.readUInt16BE(0)); time("DataView.getUInt16 (BE)", () => view.getUint16(0, false)); console.log(""); time("Buffer.readUInt16LE ", () => buf.readUInt16LE(0)); time("DataView.readUInt16 (LE)", () => view.getUint16(0, true)); console.log(""); time("Buffer.getUInt32BE ", () => buf.readUInt32BE(0)); time("DataView.getUInt32 (BE)", () => view.getUint32(0, false)); console.log(""); time("Buffer.readUInt32LE ", () => buf.readUInt32LE(0)); time("DataView.getUInt32 (LE)", () => view.getUint32(0, true)); console.log(""); time("Buffer.readUInt8 ", () => buf.readUInt8(0)); time("DataView.getUInt (t8)", () => view.getUint8(0)); console.log(""); '>logtreecommitdiff
path: root/tests (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2018-08-27enable builds on masterGravatar Jorge Aparicio 2-1/+4
2018-08-27publish docs on gh pagesGravatar Jorge Aparicio 2-0/+23
2018-08-24v0.3.3v0.3.3Gravatar Jorge Aparicio 3-4/+12
2018-08-24install newer gccGravatar Jorge Aparicio 2-24/+5
2018-08-24more fixesGravatar Jorge Aparicio 41-65/+30
2018-06-07Fix mistakes in dependenciesGravatar Ferdia McKeogh 2-5/+1
2018-06-07Fix "Could not find `Op` in `proc_macro`"Gravatar Ferdia McKeogh 4-22/+25
2018-04-16v0.3.2v0.3.2Gravatar Jorge Aparicio 1-1/+1
2018-04-16drop the cargo cacheGravatar Jorge Aparicio 1-4/+0
2018-04-16switch to a crates.io release of rtfm-syntaxGravatar Jorge Aparicio 3-3/+14
2018-04-16install rust-std componentGravatar Jorge Aparicio 1-1/+3
2018-04-16fix ci/install.shGravatar Jorge Aparicio 1-1/+1
2018-04-16don't cache the Xargo directoryGravatar Jorge Aparicio 1-4/+1
2018-04-16cargo fmtGravatar Jorge Aparicio 2-8/+4
2018-04-16update parserGravatar Jorge Aparicio 13-139/+61
closes #69 this doesn't change functionality per se but improves diagnostics in some cases. Some hard errors have becomes warnings, for example: when `resources` is empty, or when `idle.path` is set to the default `idle` path.
2018-04-16bors-ng integrationGravatar Jorge Aparicio 2-3/+5
2018-01-16v0.3.1v0.3.1Gravatar Jorge Aparicio 1-1/+8
2018-01-16specify both the path and version of the cortex-m-rtfm-macros dependencyGravatar Jorge Aparicio 1-1/+1
2018-01-15fix documentation linkGravatar Jorge Aparicio 2-3/+3
2018-01-15v0.3.0Gravatar Jorge Aparicio 11-25/+90
2018-01-11adapt to changes in the cortex-m crateGravatar Jorge Aparicio 11-42/+69
2018-01-11fix the compiletest_rs versionGravatar Jorge Aparicio 1-1/+1
2018-01-11switch to a stable release of compiletest_rsGravatar Jorge Aparicio 1-2/+1
2018-01-11use master branch of cortex-mGravatar Jorge Aparicio 1-1/+1
2017-12-23add a Cargo feature, cm7-r0p1, to fix a Cortex-M7 BASEPRI erratumGravatar Jorge Aparicio 3-2/+17
2017-12-23switch to a compiletest version that works with the latest nightlyGravatar Jorge Aparicio 1-1/+2
2017-12-23switch to master branchesGravatar Jorge Aparicio 2-3/+3
2017-12-17add missing commaGravatar Jorge Aparicio 1-1/+1
2017-12-09safe `&'static mut` references via init.resourcesGravatar Jorge Aparicio 6-10/+153
2017-12-09implement the Resource trait for owned resourcesGravatar Jorge Aparicio 11-220/+278
this unbreaks the "generics" example
2017-12-09drop the Static wrapperGravatar Jorge Aparicio 8-26/+28
2017-12-09make resource proxies not SyncGravatar Jorge Aparicio 2-3/+2
2017-12-09also cache the Xargo directoryGravatar Jorge Aparicio 1-1/+4
2017-12-09deny warnings and unsafe code in tests and examplesGravatar Jorge Aparicio 24-0/+24
2017-12-09make resource proxies !SendGravatar Jorge Aparicio 2-2/+58
2017-12-09fix the "generics" exampleGravatar Jorge Aparicio 1-2/+2
2017-12-09rename LateResourceValues to LateResourcesGravatar Jorge Aparicio 4-9/+9
2017-12-09remove special case around peripherals from codegenGravatar Jorge Aparicio 1-209/+114
2017-12-09peripherals as scoped singletonsGravatar Jorge Aparicio 7-30/+68
2017-12-08ci: switch back to a recent nightlyGravatar Jorge Aparicio 1-2/+1
2017-12-08fix cfail testsGravatar Jorge Aparicio 2-2/+2
2017-11-22use older nightly for the x86_64 linux targetGravatar Jorge Aparicio 1-1/+2
2017-11-22fix ciGravatar Jorge Aparicio 3-4/+2
2017-11-22v0.2.2v0.2.2Gravatar Jorge Aparicio 10-61/+161
2017-10-02fix the exampleGravatar Jorge Aparicio 1-2/+2
2017-10-02fix `idle::Resources::new`Gravatar Jorge Aparicio 2-2/+13
it assumed that all resources were "early" resources
2017-09-22Use `true` as the armv6 linkerGravatar Jonas Schievink 1-2/+2
Horrible hack until we switch to a Cortex-M0 device crate that works with armv6.
2017-09-22Pin Travis to Xargo 0.3.8Gravatar Jonas Schievink 1-2/+2
2017-09-22Use rtfm-syntax 0.2.0Gravatar Jonas Schievink 1-2/+1