Skip to content

Instantly share code, notes, and snippets.

#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#define US_PER_MS 1000.0
typedef uint64_t(*fn_bench)(void*);
/**
* @param benches Array of individual benchmark functions to run. Each
function bench1(numItems) {
const obj = {};
for (let i = 0; i < numItems; i++) {
obj[i] = 0;
}
let tmp;
const tStart = performance.now();
for (const item of Object.values(obj)) {
tmp = item;
}
/**
* @param {function[]} benches - Individual benchmarks to run; each one is expected to return its execution time
* @param {number} numRuns - Number of times each benchmark should be run
* @param {...*} args - Arguments to pass to each benchmark
*/
function benchmark(benches, numRuns, ...args) {
const totalTime = [];
const maxTime = [];
const minTime = [];
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Objektorientierung
{
class HugeInt