// Path: src/main/java/com/cinchapi/common/profile/Benchmark.java
// public abstract class Benchmark {
// 
//     /**
//      * The {@link TimeUnit} in which the elapsed time should be expressed when
//      * returned to the caller.
//      */
//     private final TimeUnit unit;
// 
//     /**
//      * Construct a new instance.
//      * 
//      * @param unit the desired {@link #unit time unit}
//      */
//     public Benchmark(TimeUnit unit) {
//         this.unit = unit;
//     }
// 
//     public abstract void action();
// 
//     /**
//      * Return the average run time of the {@link #action()} over the specified
//      * number of run {@code times}.
//      * 
//      * @param times
//      * @return the average run time
//      */
//     public final double average(int times) {
//         return (double) run(times) / times;
//     }
// 
//     /**
//      * Run the {@link #action() action} once and return the elapsed time,
//      * expressed in the {@link TimeUnit} that was passed into the constructor.
//      * 
//      * @return the elapsed time
//      */
//     public final long run() {
//         long start = System.nanoTime();
//         action();
//         long end = System.nanoTime();
//         return unit.convert(end - start, TimeUnit.NANOSECONDS);
//     }
// 
//     /**
//      * Run the {@link #action action} the specified number of {@times} and
//      * return the elapsed time, expressed in the {@link TimeUnit} that was
//      * passed into the constructor.
//      * 
//      * @param rounds
//      * @return the elapsed time
//      */
//     public final long run(int times) {
//         long start = System.nanoTime();
//         for (int i = 0; i < times; ++i) {
//             action();
//         }
//         long end = System.nanoTime();
//         return unit.convert(end - start, TimeUnit.NANOSECONDS);
//     }
// 
// }


import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import com.cinchapi.common.profile.Benchmark;
/*
 * Copyright (c) 2013-2019 Cinchapi Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.cinchapi.common.base;




/**
 * Unit tests to verify that {@link StringSplitter} is faster than alternative
 * methods.
 * 
 * @author Jeff Nelson
 */
public class StringSplitterPerformanceTest {

    @Test
    @Ignore
    public void testSimpleSplit() {
        String string = "The Gangs All Here,www.youtube.com/embed/VlWsLs8G7Kg,,"
                + "\"Anacostia follows the lives of the residents of ANACOSTIA, "
                + "a small residential community in Washington D.C. as they "
                + "navigate through love, betrayal, deception, sex and murder\","
                + "ANACOSTIA,3,7,,Webseries,,,";
        int rounds = 5000;
// Path: src/main/java/com/cinchapi/common/profile/Benchmark.java
// public abstract class Benchmark {
// 
//     /**
//      * The {@link TimeUnit} in which the elapsed time should be expressed when
//      * returned to the caller.
//      */
//     private final TimeUnit unit;
// 
//     /**
//      * Construct a new instance.
//      * 
//      * @param unit the desired {@link #unit time unit}
//      */
//     public Benchmark(TimeUnit unit) {
//         this.unit = unit;
//     }
// 
//     public abstract void action();
// 
//     /**
//      * Return the average run time of the {@link #action()} over the specified
//      * number of run {@code times}.
//      * 
//      * @param times
//      * @return the average run time
//      */
//     public final double average(int times) {
//         return (double) run(times) / times;
//     }
// 
//     /**
//      * Run the {@link #action() action} once and return the elapsed time,
//      * expressed in the {@link TimeUnit} that was passed into the constructor.
//      * 
//      * @return the elapsed time
//      */
//     public final long run() {
//         long start = System.nanoTime();
//         action();
//         long end = System.nanoTime();
//         return unit.convert(end - start, TimeUnit.NANOSECONDS);
//     }
// 
//     /**
//      * Run the {@link #action action} the specified number of {@times} and
//      * return the elapsed time, expressed in the {@link TimeUnit} that was
//      * passed into the constructor.
//      * 
//      * @param rounds
//      * @return the elapsed time
//      */
//     public final long run(int times) {
//         long start = System.nanoTime();
//         for (int i = 0; i < times; ++i) {
//             action();
//         }
//         long end = System.nanoTime();
//         return unit.convert(end - start, TimeUnit.NANOSECONDS);
//     }
// 
// }


// Path: src/test/java/com/cinchapi/common/base/StringSplitterPerformanceTest.java
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import com.cinchapi.common.profile.Benchmark;

/*
 * Copyright (c) 2013-2019 Cinchapi Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.cinchapi.common.base;




/**
 * Unit tests to verify that {@link StringSplitter} is faster than alternative
 * methods.
 * 
 * @author Jeff Nelson
 */
public class StringSplitterPerformanceTest {

    @Test
    @Ignore
    public void testSimpleSplit() {
        String string = "The Gangs All Here,www.youtube.com/embed/VlWsLs8G7Kg,,"
                + "\"Anacostia follows the lives of the residents of ANACOSTIA, "
                + "a small residential community in Washington D.C. as they "
                + "navigate through love, betrayal, deception, sex and murder\","
                + "ANACOSTIA,3,7,,Webseries,,,";
        int rounds = 5000;
        Benchmark builtIn = new Benchmark(TimeUnit.MICROSECONDS) {