Here you can find the source of repDiff(LocalTime start, LocalTime end, byte type)
Parameter | Description |
---|---|
start | starting time |
end | ending time |
type | unit of time reported |
public static void repDiff(LocalTime start, LocalTime end, byte type)
//package com.java2s; //License from project: Open Source License import java.time.Duration; import java.time.LocalTime; import java.time.temporal.ChronoUnit; public class Main { /**/*from ww w .j av a 2 s .co m*/ * Reports the difference between two LocalTimes * reports total difference in one unit of time * * @param start starting time * @param end ending time * @param type unit of time reported */ public static void repDiff(LocalTime start, LocalTime end, byte type) { switch (type) { case 0: //Hours break; case 1: long diff = Duration.between(start, end).get(ChronoUnit.MINUTES); break; case 2: //seconds break; default: break; } } }