How to do setup for microbencharks?

Viewed 13

I'm trying to benchmark how long rotating different image resolutions takes. Each benchmark will be rotating the given Bitmap, and is therefore editing it. I want to reset this bitmap before each benchmark, so I looked into the [IterationSetup] attribute. The docs say, however, that this should not be used for microbencmarks. Since rotating a Bitmap takes less than 100ms and therefore is a microbenchmark, I was wondering how would I go about doing Setup for such a problem if I can't use [IterationSetup]?

0 Answers
Related