mobench-runner-0.1.4 has been yanked.
mobench-runner
Lightweight benchmarking harness for mobile devices.
This crate provides the core timing infrastructure for running benchmarks on mobile platforms (Android and iOS). It's designed to be embedded in mobile apps and provides accurate timing measurements with configurable iterations and warmup cycles.
Features
- Accurate timing: High-precision timing measurements for benchmarks
- Configurable: Set iterations and warmup cycles
- Mobile-optimized: Designed for resource-constrained mobile environments
- Serializable results: Results can be serialized with serde for transmission to host
- No dependencies: Minimal dependencies for fast compilation
Usage
Add this to your Cargo.toml:
[]
= "0.1"
Basic Example
use ;
// Create a benchmark specification
let spec = BenchSpec ;
// Run a closure as a benchmark
let report = run_closure?;
// Access timing results
println!;
println!;
println!;
println!;
With Error Handling
use ;
let spec = new?;
let report = run_closure?;
Types
BenchSpec
Specification for a benchmark run:
BenchReport
Results from a benchmark run:
Provides helper methods:
mean_ns()- Mean execution timemedian_ns()- Median execution timemin_ns()- Minimum execution timemax_ns()- Maximum execution timestddev_ns()- Standard deviation
BenchSample
Individual timing sample:
Use Cases
This crate is typically used as a dependency in larger benchmarking systems:
- Mobile benchmark harness: Embed in mobile apps to run benchmarks on real devices
- Cross-platform timing: Consistent timing API across platforms
- Remote benchmarking: Serialize results and send to analysis tools
Part of mobench
This crate is part of the mobench ecosystem for mobile benchmarking:
- mobench - CLI tool for running benchmarks
- mobench-sdk - SDK for integrating benchmarks
- mobench-macros - Proc macros for
#[benchmark] - mobench-runner - This crate (timing harness)
License
Licensed under the MIT License. See LICENSE.md for details.
Copyright (c) 2026 World Foundation